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

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

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

XSDElementDeclaration.isNillable介绍

[英]Returns the value of the 'Nillable' attribute.

This represents the nillable infoset property.
[中]返回“Nillable”属性的值。
这表示nillableinfoset属性。

代码示例

代码示例来源:origin: geotools/geotools

private AttributeDescriptor createAttributeDescriptor(
    final XSDElementDeclaration elemDecl,
    int minOccurs,
    int maxOccurs,
    CoordinateReferenceSystem crs) {
  String targetNamespace = elemDecl.getTargetNamespace();
  String name = elemDecl.getName();
  Name elemName = Types.typeName(targetNamespace, name);
  AttributeType type = getTypeOf(elemDecl, crs);
  boolean nillable = elemDecl.isNillable();
  Object defaultValue = null;
  AttributeDescriptor descriptor =
      createAttributeDescriptor(
          type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue);
  descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl);
  return descriptor;
}

代码示例来源:origin: geotools/geotools

} else if (!child.isNillable()) {

代码示例来源:origin: geotools/geotools

maxOccurs = Integer.MAX_VALUE;
boolean isNillable = element.isNillable();

代码示例来源:origin: geotools/geotools

boolean nillable = elemDecl.isNillable();

代码示例来源:origin: geotools/geotools

maxOccurs = Integer.MAX_VALUE;
boolean isNillable = element.isNillable();

代码示例来源:origin: org.geotools/gt-app-schema

private AttributeDescriptor createAttributeDescriptor(
    final XSDElementDeclaration elemDecl, int minOccurs, int maxOccurs, CoordinateReferenceSystem crs) {
  String targetNamespace = elemDecl.getTargetNamespace();
  String name = elemDecl.getName();
  Name elemName = Types.typeName(targetNamespace, name);
  AttributeType type = getTypeOf(elemDecl, crs);
  boolean nillable = elemDecl.isNillable();
  Object defaultValue = null;
  AttributeDescriptor descriptor = createAttributeDescriptor(type, crs, elemName, minOccurs,
      maxOccurs, nillable, defaultValue);
  descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl);
  
  return descriptor;
}

代码示例来源:origin: org.geotools/gt-complex

private AttributeDescriptor createAttributeDescriptor(
    final XSDElementDeclaration elemDecl,
    int minOccurs,
    int maxOccurs,
    CoordinateReferenceSystem crs) {
  String targetNamespace = elemDecl.getTargetNamespace();
  String name = elemDecl.getName();
  Name elemName = Types.typeName(targetNamespace, name);
  AttributeType type = getTypeOf(elemDecl, crs);
  boolean nillable = elemDecl.isNillable();
  Object defaultValue = null;
  AttributeDescriptor descriptor =
      createAttributeDescriptor(
          type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue);
  descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl);
  return descriptor;
}

代码示例来源:origin: org.geotools/gt-app-schema

boolean nillable = elemDecl.isNillable();

代码示例来源:origin: org.geotools/gt-complex

boolean nillable = elemDecl.isNillable();

代码示例来源:origin: org.eclipse/org.eclipse.xsd

XSDElementDeclaration superXSDElementDeclaration = entry.getValue();
if (superXSDElementDeclaration.isNillable() && !subXSDElementDeclaration.isNillable())

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

XSDElementDeclaration superXSDElementDeclaration = entry.getValue();
if (superXSDElementDeclaration.isNillable() && !subXSDElementDeclaration.isNillable())

代码示例来源: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.eclipse/org.eclipse.xsd

if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
 if (xsdElementDeclaration.isNillable())
if (xsdElementDeclaration.isNillable() && !canSupportNull((EDataType)type))

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
if (maxOccurs == 1 && xsdElementDeclaration.isNillable())
 if (xsdElementDeclaration.isNillable())
if (xsdElementDeclaration.isNillable() && !canSupportNull((EDataType)type))

代码示例来源:origin: org.eclipse/org.eclipse.xsd

else if (xsdElementDeclaration.isNillable() ?
      !eStructuralFeature.isUnsettable() :
      (eType.getDefaultValue() != null || eStructuralFeature.getDefaultValueLiteral() != null) !=

代码示例来源:origin: org.eclipse.xsd/org.eclipse.xsd

else if (xsdElementDeclaration.isNillable() ?
      !eStructuralFeature.isUnsettable() :
      (eType.getDefaultValue() != null || eStructuralFeature.getDefaultValueLiteral() != null) !=

相关文章

微信公众号

最新文章

更多

XSDElementDeclaration类方法