gpt4 book ai didi

org.eclipse.xsd.XSDAttributeGroupDefinition.getContents()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 12:35:05 28 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.xsd.XSDAttributeGroupDefinition.getContents()方法的一些代码示例,展示了XSDAttributeGroupDefinition.getContents()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDAttributeGroupDefinition.getContents()方法的具体详情如下:
包路径:org.eclipse.xsd.XSDAttributeGroupDefinition
类名称:XSDAttributeGroupDefinition
方法名:getContents

XSDAttributeGroupDefinition.getContents介绍

[英]Returns the value of the 'Contents' containment reference list. The list contents are of type org.eclipse.xsd.XSDAttributeGroupContent.

This concrete reference represents the contents defined within the body of an attributeGroup element.
[中]

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected void reorderAttributeUses(List<XSDAttributeUse> attributeUses, List<XSDAttributeGroupContent> attributeContents)
{
 for (Object attributeContent : attributeContents)
 {
  if (attributeContent instanceof XSDAttributeUse)
  {
   int index = attributeUses.indexOf(attributeContent);
   if (index != -1)
   {
    attributeUses.remove(index);
    attributeUses.add((XSDAttributeUse)attributeContent);
   }
  }
  else
  {
   reorderAttributeUses(attributeUses, ((XSDAttributeGroupDefinition)attributeContent).getContents());
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public ITreeElement[] getChildren()
{
 XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target;
 List list = new ArrayList();
 list.addAll(xsdAttributeGroup.getContents());
 XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent();
 if (wildcard != null)
 {
  list.add(wildcard);
 }
 List adapterList = new ArrayList();
 populateAdapterList(list, adapterList);
 return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]);
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected void reorderAttributeUses(List<XSDAttributeUse> attributeUses, List<XSDAttributeGroupContent> attributeContents)
{
 for (Object attributeContent : attributeContents)
 {
  if (attributeContent instanceof XSDAttributeUse)
  {
   int index = attributeUses.indexOf(attributeContent);
   if (index != -1)
   {
    attributeUses.remove(index);
    attributeUses.add((XSDAttributeUse)attributeContent);
   }
  }
  else
  {
   reorderAttributeUses(attributeUses, ((XSDAttributeGroupDefinition)attributeContent).getContents());
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
{
 for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext();)
 {
  Object o = it.next();
  if (o instanceof XSDAttributeUse)
  {
   XSDAttributeUse attributeUse = (XSDAttributeUse) o;
   concreteComponentList.add(attributeUse.getAttributeDeclaration());
   thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
  }
  else if (o instanceof XSDAttributeGroupDefinition)
  {
   XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) o;
   thingsWeNeedToListenTo.add(attrGroup);
   if (attrGroup.isAttributeGroupDefinitionReference())
   {
    attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
    if (attrGroup.getContents().size() == 0)
    {
     concreteComponentList.add(new SpaceFiller("attribute")); //$NON-NLS-1$
    }
    visitAttributeGroupDefinition(attrGroup);
   }
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.xsd

protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents)
{
 Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>();
 for (XSDAttributeGroupContent xsdAttributeGroupContent :  xsdAttributeContents)
 {
  if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition)
  {
   XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent;
   result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents()));
  }
  else
  {
   XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent;
   if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL)
   {
    XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
    result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration);
   }
  }
 }
 return result;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

for (Iterator iterator = parentGroup.getContents().iterator(); iterator.hasNext();)
   parentGroup.getContents().remove(attribute.getContainer());
   break;
   ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(container);
  else
   ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(0, container);
  addedBack = true;
List attributeGroupContents = parentGroup.getContents();
for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();)
    parentGroup.getContents().add(index, selected.getContainer());
    addedBack = true;
    break;
    parentGroup.getContents().add(index, selected.getContainer());
    addedBack = true;
    break;
    parentGroup.getContents().add(index + 1, selected.getContainer());
    addedBack = true;
    break;
    parentGroup.getContents().add(index, selected.getContainer());
    addedBack = true;
    break;

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void getAttributeUses(XSDAttributeGroupDefinition attributeGroupDefinition, List list)
{
 Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
 while (i.hasNext())
 {
  XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
  if (attrGroupContent instanceof XSDAttributeGroupDefinition)
  {
   getAttributeUses((XSDAttributeGroupDefinition) attrGroupContent, list);
  }
  else
  {
   list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
  }
 }
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents)
{
 Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>();
 for (XSDAttributeGroupContent xsdAttributeGroupContent :  xsdAttributeContents)
 {
  if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition)
  {
   XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent;
   result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents()));
  }
  else
  {
   XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent;
   if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL)
   {
    XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
    result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration);
   }
  }
 }
 return result;
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
{
 for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
 {
  Object o = it.next();
  if (o instanceof XSDAttributeUse)
  {
   XSDAttributeUse attributeUse = (XSDAttributeUse)o;
   concreteComponentList.add(attributeUse.getAttributeDeclaration());
   thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration());
  }
  else if (o instanceof XSDAttributeGroupDefinition)
  {
   XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
   thingsWeNeedToListenTo.add(attrGroup);
   if (attrGroup.isAttributeGroupDefinitionReference())
   {
    attrGroup = attrGroup.getResolvedAttributeGroupDefinition();
    visitAttributeGroupDefinition(attrGroup);
   }
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup)
{
 for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); )
 {
  Object o = it.next();
  if (o instanceof XSDAttributeUse)
  {
   XSDAttributeUse attrUse = (XSDAttributeUse)o;
   visitAttributeDeclaration(attrUse.getContent());
  }
  else if (o instanceof XSDAttributeGroupDefinition)
  {
   XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o;
   visitAttributeGroupDefinition(attrGroup.getResolvedAttributeGroupDefinition());
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

protected List getModelChildren()
{
 List list = new ArrayList();
 
 XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter)getModel();
 XSDAttributeGroupDefinition attributeGroupDefinition = adapter.getXSDAttributeGroupDefinition();
 Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator();
 while (i.hasNext())
 {
  XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next();
  if (attrGroupContent instanceof XSDAttributeGroupDefinition)
  {
   list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent));
  }
  else
  {
   list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
  }
 }
 
 if (list.isEmpty())
 {
  list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel()));
 }
 return list;
}

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);

代码示例来源:origin: org.eclipse/org.eclipse.xsd

simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

List<XSDAttributeGroupContent> contents = xmiIdentityAttribs.getContents();
contents.add(createAttributeUse(xmiSchema, "label", "string", "optional", "qualified", null));
contents.add(createAttributeUse(xmiSchema, "uuid", "string", "optional", "qualified", null));
contents = xmiLinkAttribs.getContents();
contents.add(createAttributeUse(xmiSchema, "href", "string", "optional", null, null));
contents.add(createAttributeUse(xmiSchema, "idref", "IDREF", "optional", "qualified", null));
contents = xmiObjectAttribs.getContents();
contents.add(createAttributeGroupReference(xmiSchema, "IdentityAttribs"));
contents.add(createAttributeGroupReference(xmiSchema, "LinkAttribs"));

代码示例来源:origin: org.eclipse/org.eclipse.xsd

List<XSDAttributeGroupContent> contents = xmiIdentityAttribs.getContents();
contents.add(createAttributeUse(xmiSchema, "label", "string", "optional", "qualified", null));
contents.add(createAttributeUse(xmiSchema, "uuid", "string", "optional", "qualified", null));
contents = xmiLinkAttribs.getContents();
contents.add(createAttributeUse(xmiSchema, "href", "string", "optional", null, null));
contents.add(createAttributeUse(xmiSchema, "idref", "IDREF", "optional", "qualified", null));
contents = xmiObjectAttribs.getContents();
contents.add(createAttributeGroupReference(xmiSchema, "IdentityAttribs"));
contents.add(createAttributeGroupReference(xmiSchema, "LinkAttribs"));

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

attributeUse.setContent(attribute);
((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse);
formatChild(parent.getElement());

代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui

attrGroup.getContents().remove(parent);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com