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

x33g5p2x  于2022-02-03 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(98)

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

XSDModelGroup.getContents介绍

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

This concrete reference represents the org.eclipse.xsd.XSDParticleContent defined within the body of a sequence, choice, or all element.
[中]返回“Contents”包含引用列表的值。列表内容的类型为org。日食xsd。XSDParticle。
这个具体的参考代表组织。日食xsd。在sequencechoice或{$2$}元素的主体中定义的XSDParticleContent。

代码示例

代码示例来源:origin: geotools/geotools

parts = grp.getContents();

代码示例来源:origin: geotools/geotools

parts = grp.getContents();

代码示例来源:origin: geotools/geotools

dom.createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element"));
group.getContents().add(particle);

代码示例来源:origin: geotools/geotools

particle.setMaxOccurs(attributeDescriptor.getMaxOccurs());
particle.setContent(attribute);
attributes.getContents().add(particle);

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

public void visitModelGroup(XSDModelGroup modelGroup)
{
 if (modelGroup.getContents() != null)
 {
  for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
  {
   XSDParticle particle = (XSDParticle) iterator.next();
   visitParticle(particle);
  }
 }
}

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

public void visitModelGroup(XSDModelGroup modelGroup)
{
 if (modelGroup.getContents() != null)
 {
  for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();)
  {
   XSDParticle particle = (XSDParticle) iterator.next();
   visitParticle(particle);
  }
 }
}

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

public void visitModelGroup(XSDModelGroup modelGroup)
 {
  int numOfChildren = modelGroup.getContents().size();
  if (numOfChildren == 0)
  {
   concreteComponentList.add(new SpaceFiller("element")); //$NON-NLS-1$
  }
  super.visitModelGroup(modelGroup);
 }
}

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

public void visitXSDModelGroup(XSDModelGroup xsdModelGroup)
{
 indent += 2;
 for (Iterator iterator = xsdModelGroup.getContents().iterator(); iterator.hasNext(); )
 {
  visitXSDObject(iterator.next());
 } 
 indent -= 2;
}

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

protected void addElementDeclaration(XSDSchema schema, XSDModelGroup modelGroup, String name, String type, boolean schemaType)
{
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(createElementDeclaration(schema, name, type, schemaType));
 modelGroup.getContents().add(particle);
}

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

protected void addElementDeclaration(XSDSchema schema, XSDModelGroup modelGroup, String name, String type, boolean schemaType)
{
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(createElementDeclaration(schema, name, type, schemaType));
 modelGroup.getContents().add(particle);
}

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

public void undo()
{
 super.undo();
 
 if (parent instanceof XSDModelGroup)
 {
  XSDModelGroup model = (XSDModelGroup) parent;
  model.getContents().remove(newModelGroup.getContainer());
 }
}

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

protected XSDModelGroup createAnyModelGroup(String processContents)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(createAny(processContents));
 modelGroup.getContents().add(particle);
 return modelGroup;
}

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

protected void addElementDeclarationReference(XSDSchema schema, XSDModelGroup modelGroup, String reference)
{
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 elementDeclaration.setResolvedElementDeclaration(schema.resolveElementDeclaration(reference));
 particle.setContent(elementDeclaration);
 modelGroup.getContents().add(particle);
}

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

protected XSDModelGroup createAnyModelGroup(String processContents)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(createAny(processContents));
 modelGroup.getContents().add(particle);
 return modelGroup;
}

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

protected void addElementDeclarationReference(XSDSchema schema, XSDModelGroup modelGroup, String reference)
{
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 XSDElementDeclaration elementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 elementDeclaration.setResolvedElementDeclaration(schema.resolveElementDeclaration(reference));
 particle.setContent(elementDeclaration);
 modelGroup.getContents().add(particle);
}

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

protected void addXMIExtension(XSDModelGroup modelGroup)
{
 if (!minimizedXMI)
 {
  importXMI();
  XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
  XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
  xsdElementDeclaration.setResolvedElementDeclaration(xsdElementDeclaration.resolveElementDeclaration(XMI_URI, "Extension"));
  particle.setContent(xsdElementDeclaration);
  modelGroup.getContents().add(particle);
 }
}

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

protected void addXMIExtension(XSDModelGroup modelGroup)
{
 if (!minimizedXMI)
 {
  importXMI();
  XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
  XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
  xsdElementDeclaration.setResolvedElementDeclaration(xsdElementDeclaration.resolveElementDeclaration(XMI_URI, "Extension"));
  particle.setContent(xsdElementDeclaration);
  modelGroup.getContents().add(particle);
 }
}

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

protected void makeReferenceElement(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup modelGroup = getModelGroup(xsdComplexTypeDefinition);
 XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
 xsdElementDeclaration.setName(getName(reference));
 if (reference.isUnsettable() && !reference.isMany())
 {
  xsdElementDeclaration.setNillable(true);
 }
 setReferenceElementType(reference, xsdElementDeclaration);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(xsdElementDeclaration);
 setReferenceElementMultiplicity(reference, particle);
 modelGroup.getContents().add(particle);
 map(particle, reference);
}

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

protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature)
{
 XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition);
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle();
 xsdParticle.setContent(modelGroup);
 if (eStructuralFeature.getUpperBound() != 1)
 {
  xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound());
 }
 xsdModelGroup.getContents().add(xsdParticle);
 map(xsdParticle, eStructuralFeature);
 createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName());
 buildAnnotations(xsdModelGroup, eStructuralFeature);
 return xsdParticle;
}

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

protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature)
{
 XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition);
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle();
 xsdParticle.setContent(modelGroup);
 if (eStructuralFeature.getUpperBound() != 1)
 {
  xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound());
 }
 xsdModelGroup.getContents().add(xsdParticle);
 map(xsdParticle, eStructuralFeature);
 createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName());
 buildAnnotations(xsdModelGroup, eStructuralFeature);
 return xsdParticle;
}

相关文章