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

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

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

XSDFactory.createXSDModelGroup介绍

[英]Returns a new object of class 'Model Group'.
[中]返回类“模型组”的新对象。

代码示例

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

type.setBaseTypeDefinition(schemaIndex.getTypeDefinition(gml.qName("AbstractFeatureType")));
XSDModelGroup group = f.createXSDModelGroup();
group.setCompositor(XSDCompositor.SEQUENCE_LITERAL);

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

protected XSDModelGroupDefinition createUnresolvedModelGroupDefinition(String namespace, String localName)
{
 XSDModelGroupDefinition xsdModelGroupDefinition = XSDFactory.eINSTANCE.createXSDModelGroupDefinition();
 if (localName != null)
 {
  xsdModelGroupDefinition.setName(localName);
 }
 if (namespace != null)
 {
  xsdModelGroupDefinition.setTargetNamespace(namespace);
 }
 xsdModelGroupDefinition.setResolvedModelGroupDefinition(xsdModelGroupDefinition);
 XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 xsdModelGroupDefinition.setModelGroup(xsdModelGroup);
 return xsdModelGroupDefinition;
}

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

XSDModelGroup attributes = factory.createXSDModelGroup();
attributes.setCompositor(XSDCompositor.SEQUENCE_LITERAL);

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

protected XSDModelGroupDefinition createUnresolvedModelGroupDefinition(String namespace, String localName)
{
 XSDModelGroupDefinition xsdModelGroupDefinition = XSDFactory.eINSTANCE.createXSDModelGroupDefinition();
 if (localName != null)
 {
  xsdModelGroupDefinition.setName(localName);
 }
 if (namespace != null)
 {
  xsdModelGroupDefinition.setTargetNamespace(namespace);
 }
 xsdModelGroupDefinition.setResolvedModelGroupDefinition(xsdModelGroupDefinition);
 XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 xsdModelGroupDefinition.setModelGroup(xsdModelGroup);
 return xsdModelGroupDefinition;
}

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

/**
 * This is a convenience method for creating {@link CommandParameter}s
 * for model groups of two or all of the three compositor types
 * (choice, sequence, and optionally all, depending on the value of
 * <code>all</code>) and adding them to a <code>newChildDescriptors</code>
 * collection.  If <code>useParticle</code> is <code>true</code>, each
 * model group will be the content of a new particle.
 */
protected void addModelGroupChildParameters(Collection<Object> newChildDescriptors,
                      EReference feature,
                      boolean all,
                      boolean useParticle)
{
 XSDCompositor[] compositor = { XSDCompositor.ALL_LITERAL, XSDCompositor.CHOICE_LITERAL, XSDCompositor.SEQUENCE_LITERAL };
 for (int i = all ? 0 : 1; i < compositor.length; i++)
 {
  XSDModelGroup mg = xsdFactory.createXSDModelGroup();
  mg.setCompositor(compositor[i]);
  XSDConcreteComponent child = mg;
  if (useParticle)
  {
   child = createParticle(mg, false);
  }
  newChildDescriptors.add(createChildParameter(feature, child));
 }
}

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

public static XSDModelGroup createModelGroup(Node node)
{
 switch (XSDConstants.nodeType(node))
 {
  case XSDConstants.ALL_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.ALL_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.CHOICE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.SEQUENCE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
 }
 return null;
}

代码示例来源: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/org.eclipse.xsd

public static XSDModelGroup createModelGroup(Node node)
{
 switch (XSDConstants.nodeType(node))
 {
  case XSDConstants.ALL_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.ALL_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.CHOICE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
  case XSDConstants.SEQUENCE_ELEMENT:
  {
   XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
   xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
   xsdModelGroup.setElement((Element)node);
   return xsdModelGroup;
  }
 }
 return null;
}

代码示例来源: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.xsd/org.eclipse.xsd

protected XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle();
 xsdParticle.setContent(xsdModelGroup);
 xsdComplexTypeDefinition.setContent(xsdParticle);
 return xsdModelGroup;
}

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

protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(modelGroup);
 xsdComplexTypeDefinition.setContent(particle);
 return modelGroup;
}

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

protected XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle();
 xsdParticle.setContent(xsdModelGroup);
 xsdComplexTypeDefinition.setContent(xsdParticle);
 return xsdModelGroup;
}

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

protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setContent(modelGroup);
 xsdComplexTypeDefinition.setContent(particle);
 return modelGroup;
}

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

protected XSDModelGroup createModelGroup()
{
 XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
 XSDParticle particle = factory.createXSDParticle();
 XSDModelGroup modelGroup = factory.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
 particle.setContent(modelGroup);
 return modelGroup;
}

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

protected XSDModelGroup createModelGroup()
 {
  
  XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory();
  XSDParticle particle = factory.createXSDParticle();
  XSDModelGroup modelGroup = factory.createXSDModelGroup();
  modelGroup.setCompositor(xsdCompositor);
  particle.setContent(modelGroup);
  addedXSDConcreteComponent = modelGroup;
  return modelGroup;
 }
}

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

@Override
protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setMinOccurs(0);
 particle.setMaxOccurs(-1);
 particle.setContent(modelGroup);
 xsdComplexTypeDefinition.setContent(particle);
 return modelGroup;
}

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

@Override
protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup();
 modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL);
 XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
 particle.setMinOccurs(0);
 particle.setMaxOccurs(-1);
 particle.setContent(modelGroup);
 xsdComplexTypeDefinition.setContent(particle);
 return modelGroup;
}

代码示例来源: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;
}

代码示例来源: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.xsd/org.eclipse.xsd

@Override
 public XSDConcreteComponent cloneConcreteComponent(boolean deep, boolean shareDOM)
 {
  XSDModelGroupImpl clonedModelGroup =
   (XSDModelGroupImpl)getXSDFactory().createXSDModelGroup();
  clonedModelGroup.isReconciling = true;

  clonedModelGroup.setCompositor(getCompositor());

  if (deep)
  {
   if (getAnnotation() != null)
   {
    clonedModelGroup.setAnnotation((XSDAnnotation)getAnnotation().cloneConcreteComponent(deep, shareDOM));
   }
   if (!getContents().isEmpty())
   {
    clonedModelGroup.getContents().addAll(cloneConcreteComponents(getContents(), true, shareDOM));
   }
  }

  if (shareDOM && getElement() != null)
  {
   clonedModelGroup.setElement(getElement());
  }

  clonedModelGroup.isReconciling = shareDOM;
  return clonedModelGroup;
 }
}

相关文章

微信公众号

最新文章

更多