本文整理了Java中org.eclipse.xsd.XSDElementDeclaration.setNillable()
方法的一些代码示例,展示了XSDElementDeclaration.setNillable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSDElementDeclaration.setNillable()
方法的具体详情如下:
包路径:org.eclipse.xsd.XSDElementDeclaration
类名称:XSDElementDeclaration
方法名:setNillable
[英]Sets the value of the ' org.eclipse.xsd.XSDElementDeclaration#isNillable' attribute.
[中]设置“组织”的值。日食xsd。XSDElementDeclaration#isNillable'属性。
代码示例来源:origin: geotools/geotools
element.setNillable(attribute.isNillable());
代码示例来源:origin: geotools/geotools
attribute.setNillable(attributeDescriptor.isNillable());
代码示例来源:origin: org.geoserver/wfsv
static XSDParticle particle(XSDSchema schema, String elementName,
String typeNS, String typeName, boolean nillable, int minOccurs,
int maxOccurs) {
XSDFactory factory = XSDFactory.eINSTANCE;
XSDElementDeclaration element = factory.createXSDElementDeclaration();
element.setName(elementName);
element.setNillable(nillable);
XSDTypeDefinition type = schema.resolveTypeDefinition(typeNS, typeName);
element.setTypeDefinition(type);
XSDParticle particle = factory.createXSDParticle();
particle.setMinOccurs(minOccurs);
particle.setMaxOccurs(maxOccurs);
particle.setContent(element);
return particle;
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void makeReferenceElement(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDModelGroup modelGroup = getModelGroup(xsdComplexTypeDefinition);
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(getName(reference));
if (reference.isUnsettable() && !reference.isMany())
{
xsdElementDeclaration.setNillable(true);
}
setReferenceElementType(reference, xsdElementDeclaration);
XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
particle.setContent(xsdElementDeclaration);
setReferenceElementMultiplicity(reference, particle);
modelGroup.getContents().add(particle);
map(particle, reference);
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void makeReferenceElement(EReference reference, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDModelGroup modelGroup = getModelGroup(xsdComplexTypeDefinition);
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(getName(reference));
if (reference.isUnsettable() && !reference.isMany())
{
xsdElementDeclaration.setNillable(true);
}
setReferenceElementType(reference, xsdElementDeclaration);
XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
particle.setContent(xsdElementDeclaration);
setReferenceElementMultiplicity(reference, particle);
modelGroup.getContents().add(particle);
map(particle, reference);
}
代码示例来源:origin: org.geoserver/gs-wfs
element.setNillable(attribute.isNillable());
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature)
{
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(extendedMetaData.getName(eStructuralFeature));
EClassifier eType = eStructuralFeature.getEType();
XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eType));
handleImport(xsdSchema, xsdTypeDefinition);
xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition);
if (isWrapperType(eType))
{
xsdElementDeclaration.setNillable(true);
}
String defaultValue = eStructuralFeature.getDefaultValueLiteral();
if (defaultValue != null)
{
xsdElementDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL);
xsdElementDeclaration.setLexicalValue(defaultValue);
}
xsdSchema.getContents().add(xsdElementDeclaration);
map(xsdElementDeclaration, eStructuralFeature);
if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE))
{
createEcoreAnnotation(xsdElementDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType()));
}
buildAnnotations(xsdElementDeclaration, eStructuralFeature);
return xsdElementDeclaration;
}
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
protected void createAttributeElementDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDModelGroup modelGroup = getModelGroup(xsdComplexTypeDefinition);
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(getName(attribute));
// If the attribute can have a null value (primitives and enums can't), and
// if the attribute can hold many nulls or
// it can hold only a single value that is allowed to be null
// and it can be considered set when it has the null value...
//
if (attribute.getEType().getDefaultValue() == null
&& (attribute.isMany() || (!attribute.isRequired() && (attribute.getDefaultValueLiteral() != null || attribute.isUnsettable()))))
{
xsdElementDeclaration.setNillable(true);
}
if (xsdElementDeclaration.isNillable() || attribute.isMany() || !minimizedXMI)
{
XSDSimpleTypeDefinition attrType = getType(attribute.getEAttributeType());
if (attrType != null)
{
xsdElementDeclaration.setTypeDefinition(attrType);
}
XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
particle.setContent(xsdElementDeclaration);
setAttributeElementMultiplicity(attribute, particle);
modelGroup.getContents().add(particle);
map(particle, attribute);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.xsd
protected void createAttributeElementDeclaration(EAttribute attribute, XSDComplexTypeDefinition xsdComplexTypeDefinition)
{
XSDModelGroup modelGroup = getModelGroup(xsdComplexTypeDefinition);
XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration();
xsdElementDeclaration.setName(getName(attribute));
// If the attribute can have a null value (primitives and enums can't), and
// if the attribute can hold many nulls or
// it can hold only a single value that is allowed to be null
// and it can be considered set when it has the null value...
//
if (attribute.getEType().getDefaultValue() == null
&& (attribute.isMany() || (!attribute.isRequired() && (attribute.getDefaultValueLiteral() != null || attribute.isUnsettable()))))
{
xsdElementDeclaration.setNillable(true);
}
if (xsdElementDeclaration.isNillable() || attribute.isMany() || !minimizedXMI)
{
XSDSimpleTypeDefinition attrType = getType(attribute.getEAttributeType());
if (attrType != null)
{
xsdElementDeclaration.setTypeDefinition(attrType);
}
XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle();
particle.setContent(xsdElementDeclaration);
setAttributeElementMultiplicity(attribute, particle);
modelGroup.getContents().add(particle);
map(particle, attribute);
}
}
代码示例来源:origin: org.geoserver/gs-wfs
element.setNillable(attribute.isNillable());
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
xsdElementDeclaration.setNillable(true);
代码示例来源:origin: org.eclipse/org.eclipse.xsd
(eStructuralFeature.getDefaultValueLiteral() != null || eStructuralFeature.isUnsettable())))))
xsdElementDeclaration.setNillable(true);
代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd
(eStructuralFeature.getDefaultValueLiteral() != null || eStructuralFeature.isUnsettable())))))
xsdElementDeclaration.setNillable(true);
内容来源于网络,如有侵权,请联系作者删除!