本文整理了Java中org.eclipse.xsd.XSDAttributeUse.setContent()
方法的一些代码示例,展示了XSDAttributeUse.setContent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDAttributeUse.setContent()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDAttributeUse
类名称:XSDAttributeUse
方法名:setContent
[英]Sets the value of the ' org.eclipse.xsd.XSDAttributeUse#getContent' containment reference.
[中]设置“组织”的值。日食xsd。XSDAttributeUse#getContent'包含参考。
代码示例来源: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.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/org.eclipse.xsd
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
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.xsd/org.eclipse.xsd
simpleAttributeUseGroupMember./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationGroupMember);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
代码示例来源:origin: org.eclipse/org.eclipse.xsd
simpleAttributeUseGroupMember./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationGroupMember);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue");
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
attributeUse.setContent(attribute);
attributeUse.setContent(attribute);
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
xsdAttributeUse.setContent(xsdAttributeDeclaration);
xsdComplexTypeDefinition.getAttributeContents().add(xsdAttributeUse);
map(xsdAttributeUse, eStructuralFeature);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
xsdAttributeUse.setContent(xsdAttributeDeclaration);
xsdComplexTypeDefinition.getAttributeContents().add(xsdAttributeUse);
map(xsdAttributeUse, eStructuralFeature);
内容来源于网络,如有侵权,请联系作者删除!