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

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

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

XSDFactory.createXSDAttributeUse介绍

[英]Returns a new object of class 'Attribute Use'.
[中]

代码示例

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

public static XSDAttributeUse createAttributeUse(Node node)
{
 if (XSDConstants.nodeType(node) == XSDConstants.ATTRIBUTE_ELEMENT)
 {
  XSDAttributeUse xsdAttributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
  xsdAttributeUse.setElement((Element)node);
  XSDAttributeDeclaration xsdAttributeDeclaration = XSDAttributeDeclarationImpl.createAttributeDeclaration(node);
  xsdAttributeUse.setContent(xsdAttributeDeclaration);
  return xsdAttributeUse;
 }
 return null;
}

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

public static XSDAttributeUse createAttributeUse(Node node)
{
 if (XSDConstants.nodeType(node) == XSDConstants.ATTRIBUTE_ELEMENT)
 {
  XSDAttributeUse xsdAttributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
  xsdAttributeUse.setElement((Element)node);
  XSDAttributeDeclaration xsdAttributeDeclaration = XSDAttributeDeclarationImpl.createAttributeDeclaration(node);
  xsdAttributeUse.setContent(xsdAttributeDeclaration);
  return xsdAttributeUse;
 }
 return null;
}

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

protected XSDAttributeUse createAttributeReference(XSDSchema schema, String name)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setResolvedAttributeDeclaration(schema.resolveAttributeDeclaration(name));
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 return attributeUse;
}

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

protected XSDAttributeUse createAttributeReference(XSDSchema schema, String name)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setResolvedAttributeDeclaration(schema.resolveAttributeDeclaration(name));
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 return attributeUse;
}

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

protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(reference));
 setReferenceAttribType(attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, reference);
}

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

protected void makeReferenceAttribute(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(reference));
 setReferenceAttribType(attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, reference);
}

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

/**
 * This creates an object of type <code>XSDAttributeUse</code> containing
 * an object of type <code>XSDAttributeDeclaration</code> -- if
 * <code>isReference</code> is <code>true</code>, the attribute use
 * content will be a new attribute declaration that resolves to 
 * <code>attributeDeclaration</code>; otherwise, it will be simply
 * <code>attributeDeclaration</code> itself.
 */
protected XSDAttributeUse createAttributeUse(XSDAttributeDeclaration attributeDeclaration, boolean isReference)
{
 XSDAttributeUse au = xsdFactory.createXSDAttributeUse();
 if (isReference)
 {
  XSDAttributeDeclaration ref = xsdFactory.createXSDAttributeDeclaration();
  ref.setResolvedAttributeDeclaration(attributeDeclaration);
  au.setContent(ref);
 }
 else
 {
  au.setContent(attributeDeclaration);
 }
 return au;
}

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

XSDAttributeUse attrUse = xsdFactory.createXSDAttributeUse();
attrUse.setContent(attrDecl);
((XSDComplexTypeDefinition)component).getAttributeContents().add(attrUse);

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

protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(attribute));
 setAttributeType(attribute, attrDecl);
 setDefaultValue(attribute, attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 setUseToRequired(attribute, attrUse);
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, attribute);
}

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

protected void createAttributeDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attrDecl.setName(getName(attribute));
 setAttributeType(attribute, attrDecl);
 setDefaultValue(attribute, attrDecl);
 XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 setUseToRequired(attribute, attrUse);
 attrUse.setContent(attrDecl);
 xsdComplexTypeDefinition.getAttributeContents().add(attrUse);
 map(attrUse, attribute);
}

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

XSDAttributeUse attrUse = xsdFactory.createXSDAttributeUse();
attrUse.setContent(attrDecl);
((XSDComplexTypeDefinition)component).getAttributeContents().add(attrUse);

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

protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setName(name);
 attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 if ("qualified".equals(form))
 {
  attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL);
 }
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 if ("optional".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
 }
 if ("required".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
 }
 if (fixed != null)
 {
  attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL);
  attributeUse.setLexicalValue("2.0");
 }
 return attributeUse;
}

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

protected XSDAttributeUse createAttributeUse(XSDSchema schema, String name, String type, String use, String form, String fixed)
{
 XSDAttributeDeclaration attributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
 attributeDeclaration.setName(name);
 attributeDeclaration.setTypeDefinition(schema.getSchemaForSchema().resolveSimpleTypeDefinition(type));
 if ("qualified".equals(form))
 {
  attributeDeclaration.setForm(XSDForm.QUALIFIED_LITERAL);
 }
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setContent(attributeDeclaration);
 if ("optional".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
 }
 if ("required".equals(use))
 {
  attributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
 }
 if (fixed != null)
 {
  attributeUse.setConstraint(XSDConstraint.FIXED_LITERAL);
  attributeUse.setLexicalValue("2.0");
 }
 return attributeUse;
}

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

protected void addXMIAttributes(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 if (!minimizedXMI)
 {
  importXMI();
  XSDAttributeGroupDefinition objAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
  objAttribs.setResolvedAttributeGroupDefinition(objAttribs.resolveAttributeGroupDefinition(XMI_URI, "ObjectAttribs"));
  xsdComplexTypeDefinition.getAttributeContents().add(0, objAttribs);
 }
 else
 {
  if (!useEncodedAttributeStyle)
  {
   importXMI();
   XSDAttributeGroupDefinition linkAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
   linkAttribs.setResolvedAttributeGroupDefinition(linkAttribs.resolveAttributeGroupDefinition(XMI_URI, "LinkAttribs"));
   xsdComplexTypeDefinition.getAttributeContents().add(0, linkAttribs);
  }
 }
 if (!minimizedXMI)
 {
  importXMI();
  XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
  attrDecl.setResolvedAttributeDeclaration(attrDecl.resolveAttributeDeclaration(XMI_URI, "id"));
  XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
  attrUse.setContent(attrDecl);
  xsdComplexTypeDefinition.getAttributeContents().add(0, attrUse);
 }
}

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

protected void addXMIAttributes(XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
 if (!minimizedXMI)
 {
  importXMI();
  XSDAttributeGroupDefinition objAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
  objAttribs.setResolvedAttributeGroupDefinition(objAttribs.resolveAttributeGroupDefinition(XMI_URI, "ObjectAttribs"));
  xsdComplexTypeDefinition.getAttributeContents().add(0, objAttribs);
 }
 else
 {
  if (!useEncodedAttributeStyle)
  {
   importXMI();
   XSDAttributeGroupDefinition linkAttribs = XSDFactory.eINSTANCE.createXSDAttributeGroupDefinition();
   linkAttribs.setResolvedAttributeGroupDefinition(linkAttribs.resolveAttributeGroupDefinition(XMI_URI, "LinkAttribs"));
   xsdComplexTypeDefinition.getAttributeContents().add(0, linkAttribs);
  }
 }
 if (!minimizedXMI)
 {
  importXMI();
  XSDAttributeDeclaration attrDecl = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();
  attrDecl.setResolvedAttributeDeclaration(attrDecl.resolveAttributeDeclaration(XMI_URI, "id"));
  XSDAttributeUse attrUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
  attrUse.setContent(attrDecl);
  xsdComplexTypeDefinition.getAttributeContents().add(0, attrUse);
 }
}

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

XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
attributeUse.setAttributeDeclaration(attribute);
attributeUse.setContent(attribute);
 XSDAttributeUse attributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
 attributeUse.setAttributeDeclaration(attribute);
 attributeUse.setContent(attribute);

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

(XSDAttributeUseImpl)getXSDFactory().createXSDAttributeUse();
clonedAttributeUse.isReconciling = true;

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

(XSDAttributeUseImpl)getXSDFactory().createXSDAttributeUse();
clonedAttributeUse.isReconciling = true;

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

XSDAttributeUse xsdAttributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();

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

XSDAttributeUse xsdAttributeUse = XSDFactory.eINSTANCE.createXSDAttributeUse();
XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration();

相关文章

微信公众号

最新文章

更多