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