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

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

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

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);

相关文章