本文整理了Java中org.eclipse.xsd.XSDAttributeUse.setUse()
方法的一些代码示例,展示了XSDAttributeUse.setUse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDAttributeUse.setUse()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDAttributeUse
类名称:XSDAttributeUse
方法名:setUse
[英]Sets the value of the ' org.eclipse.xsd.XSDAttributeUse#getUse' attribute.
[中]设置“组织”的值。日食xsd。XSDAttributeUse#getUse'属性。
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void setUseToRequired(EAttribute attribute, XSDAttributeUse attrUse)
{
if (attribute.isRequired())
{
attrUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void setUseToRequired(EAttribute attribute, XSDAttributeUse attrUse)
{
if (attribute.isRequired())
{
attrUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void undo()
{
if (component instanceof XSDParticle)
{
if (removeMinOccursAttribute)
{
((XSDParticle) component).unsetMinOccurs();
}
else
{
((XSDParticle) component).setMinOccurs(oldMinOccurs);
}
}
else if (component instanceof XSDAttributeUse)
{
if (removeMinOccursAttribute)
{
((XSDParticle) component).unsetMinOccurs();
}
else
{
if (oldMinOccurs == 1)
((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
else
((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
}
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void execute()
{
Element element = component.getElement();
try
{
beginRecording(element);
String currentMin = element.getAttribute(XSDConstants.MINOCCURS_ATTRIBUTE);
removeMinOccursAttribute = (currentMin == null) ? true : false;
if (component instanceof XSDParticle)
{
oldMinOccurs = ((XSDParticle) component).getMinOccurs();
((XSDParticle) component).setMinOccurs(newMinOccurs);
}
else if (component instanceof XSDAttributeUse)
{
oldMinOccurs = (((XSDAttributeUse) component).getUse() == XSDAttributeUseCategory.REQUIRED_LITERAL ? 1 : 0);
if (newMinOccurs == 1)
((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
else
((XSDAttributeUse) component).setUse(XSDAttributeUseCategory.OPTIONAL_LITERAL);
}
}
finally
{
endRecording();
}
}
代码示例来源: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.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.xsd/org.eclipse.xsd
/*{@link */XSDAttributeUse/*}*/ simpleAttributeUse = xsdFactory.createXSDAttributeUse();
simpleAttributeUse./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationReference);
simpleAttributeUse./*{@link XSDAttributeUse#setUse */setUse/*}*/(/*{@link */XSDAttributeUseCategory/*}*/.OPTIONAL_LITERAL);
simpleRecursiveComplexTypeDefinition./*{@link XSDComplexTypeDefinition#getAttributeContents */getAttributeContents/*}*/().add(simpleAttributeUse);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
/*{@link */XSDAttributeUse/*}*/ simpleAttributeUse = xsdFactory.createXSDAttributeUse();
simpleAttributeUse./*{@link XSDAttributeUse#setContent */setContent/*}*/(simpleAttributeDeclarationReference);
simpleAttributeUse./*{@link XSDAttributeUse#setUse */setUse/*}*/(/*{@link */XSDAttributeUseCategory/*}*/.OPTIONAL_LITERAL);
simpleRecursiveComplexTypeDefinition./*{@link XSDComplexTypeDefinition#getAttributeContents */getAttributeContents/*}*/().add(simpleAttributeUse);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
simpleAttributeUse.setUse(/*{@link */XSDAttributeUseCategory/*}*/.OPTIONAL_LITERAL);
simpleContentComplexTypeDefinition./*{@link XSDComplexTypeDefinition#getAttributeContents */getAttributeContents/*}*/().add(simpleAttributeUse);
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
simpleAttributeUse.setUse(/*{@link */XSDAttributeUseCategory/*}*/.OPTIONAL_LITERAL);
simpleContentComplexTypeDefinition./*{@link XSDComplexTypeDefinition#getAttributeContents */getAttributeContents/*}*/().add(simpleAttributeUse);
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
xsdAttriuteUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
canHaveDefault = false;
代码示例来源:origin: org.eclipse/org.eclipse.xsd
xsdAttriuteUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
canHaveDefault = false;
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
XSDAttributeUse partNumAttributeUse = xsdFactory.createXSDAttributeUse();
partNumAttributeUse.setContent(partNum);
partNumAttributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
itemsType.getAttributeContents().add(partNumAttributeUse);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
XSDAttributeUse partNumAttributeUse = xsdFactory.createXSDAttributeUse();
partNumAttributeUse.setContent(partNum);
partNumAttributeUse.setUse(XSDAttributeUseCategory.REQUIRED_LITERAL);
itemsType.getAttributeContents().add(partNumAttributeUse);
内容来源于网络,如有侵权,请联系作者删除!