# com.bea.xml
SchemaProperty Interface

public interface SchemaProperty

Represents a summary of similar SchemaFields in a complex type.

In a schema type, every element with the same name must have the same type. Therefore, all together, elements with the same name form a coherent collection of similar elements. Similarly, attributes can only be defined once, so each attribute obviously is a coherent group on its own.

A SchemaProperty represents a summary of the the elements with a given name or the attribute with a given name. It represents the summary cardinality of the fields, the summary default and fixed values, and so on. When inferring information about an element or attribute, it is typically easier to consult then SchemaProperty than to hunt for the exact SchemaField in the particle tree or attribute model.

Related Topics

``SchemaType.getProperties()``
``SchemaType.getAttributeProperties()``
``SchemaType.getElementProperties()``
``SchemaType.getAttributeProperty(QName)``
``SchemaType.getElementProperty(QName)``

## Field Summary

`public static final int` | `CONSISTENTLY` Applies to all elements for this property.
`public static final int` | `JAVA_BIG_DECIMAL` A `BigDecimal```.
`public static final int` | `JAVA_BIG_INTEGER` A `BigInteger```.
`public static final int` | `JAVA_BOOLEAN` A Java boolean.
`public static final int` | `JAVA_BYTE` A Java byte.
`public static final int` | `JAVA_BYTE_ARRAY` A byte[].
`public static final int` | `JAVA_CALENDAR` A `Calendar```.
`public static final int` | `JAVA_DATE` A `Date```.
`public static final int` | `JAVA_DOUBLE` A Java double.
`public static final int` | `JAVA_ENUM` A generated `StringEnumAbstractBase``` subclass.
`public static final int` | `JAVA_FIRST_PRIMITIVE` Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.
`public static final int` | `JAVA_FLOAT` A Java float.
`public static final int` | `JAVA_GDATE` A `GDate```.
`public static final int` | `JAVA_GDURATION` A `GDuration```.
`public static final int` | `JAVA_INT` A Java int.
`public static final int` | `JAVA_LAST_PRIMITIVE` Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.
`public static final int` | `JAVA_LIST` A `List```.
`public static final int` | `JAVA_LONG` A Java long.
`public static final int` | `JAVA_OBJECT` A `Object```, used for some simple type unions.
`public static final int` | `JAVA_QNAME` A `QName```.
`public static final int` | `JAVA_SHORT` A Java short.
`public static final int` | `JAVA_STRING` A `String```.
`public static final int` | `NEVER` Applies to no elements for this property.
`public static final int` | `VARIABLE` Applies to some, but not other elements for this property.
`public static final int` | `XML_OBJECT` An XML Bean type that inherits from `XmlObject```.

## Method Summary

`public `QName`[]` | `acceptedNames`() For element properties the set of names that are accepted for this property if this element is the head of a substitution group.
`public boolean` | `extendsJavaArray`() True if there is a Java getter that returns an array.
`public boolean` | `extendsJavaOption`() True if there is an Java isSet method that tests for presence.
`public boolean` | `extendsJavaSingleton`() True if there is a Java getter that returns a singleton.
`public `SchemaType`` | `getContainerType`() The type within which this property appears
`public `String`` | `getDefaultText`() Returns the default or fixed value, if it is consistent.
`public `XmlAnySimpleType`` | `getDefaultValue`() Returns the default or fixed value as a strongly-typed value, if it is consistent.
`public `String`` | `getJavaPropertyName`() The Java name for this property.
`public `QNameSet`` | `getJavaSetterDelimiter`() Returns the set of element names which should appear strictly after all occurences of the elements described by this property.
`public int` | `getJavaTypeCode`() Returns the natural Java type for this property.
`public `BigInteger`` | `getMaxOccurs`() Returns a summarized minimum occurrance number.
`public `BigInteger`` | `getMinOccurs`() Returns a summarized minimum occurrance number.
`public `QName`` | `getName`() The name of this element or attribute
`public `SchemaType`` | `getType`() The schema type for the property.
`public int` | `hasDefault`() Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` defaulted, depending on the defaults present in the elements in this property.
`public int` | `hasFixed`() Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` fixed, depending on the fixed constraints present in the elements in this property.
`public int` | `hasNillable`() Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` nillable, depending on the nillability of the elements in this property.
`public boolean` | `isAttribute`() True for attributes.
`public boolean` | `isReadOnly`() True for read-only properties.
`public `SchemaType`` | `javaBasedOnType`() The schema type returned from the Java getter for this property.

## Field Detail

### CONSISTENTLY

    public static final int CONSISTENTLY

  Applies to all elements for this property. See `SchemaProperty.hasNillable()```, `SchemaProperty.hasDefault()```, `SchemaProperty.hasFixed()```

### JAVA_BIG_DECIMAL

    public static final int JAVA_BIG_DECIMAL

  A `BigDecimal```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_BIG_INTEGER

    public static final int JAVA_BIG_INTEGER

  A `BigInteger```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_BOOLEAN

    public static final int JAVA_BOOLEAN

  A Java boolean. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_BYTE

    public static final int JAVA_BYTE

  A Java byte. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_BYTE_ARRAY

    public static final int JAVA_BYTE_ARRAY

  A byte[]. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_CALENDAR

    public static final int JAVA_CALENDAR

  A `Calendar```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_DATE

    public static final int JAVA_DATE

  A `Date```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_DOUBLE

    public static final int JAVA_DOUBLE

  A Java double. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_ENUM

    public static final int JAVA_ENUM

  A generated `StringEnumAbstractBase``` subclass. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_FIRST_PRIMITIVE

    public static final int JAVA_FIRST_PRIMITIVE

  Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.

### JAVA_FLOAT

    public static final int JAVA_FLOAT

  A Java float. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_GDATE

    public static final int JAVA_GDATE

  A `GDate```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_GDURATION

    public static final int JAVA_GDURATION

  A `GDuration```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_INT

    public static final int JAVA_INT

  A Java int. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_LAST_PRIMITIVE

    public static final int JAVA_LAST_PRIMITIVE

  Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.

### JAVA_LIST

    public static final int JAVA_LIST

  A `List```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_LONG

    public static final int JAVA_LONG

  A Java long. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_OBJECT

    public static final int JAVA_OBJECT

  A `Object```, used for some simple type unions. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_QNAME

    public static final int JAVA_QNAME

  A `QName```. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_SHORT

    public static final int JAVA_SHORT

  A Java short. See `SchemaProperty.getJavaTypeCode()```.

### JAVA_STRING

    public static final int JAVA_STRING

  A `String```. See `SchemaProperty.getJavaTypeCode()```.

### NEVER

    public static final int NEVER

  Applies to no elements for this property. See `SchemaProperty.hasNillable()```, `SchemaProperty.hasDefault()```, `SchemaProperty.hasFixed()```

### VARIABLE

    public static final int VARIABLE

  Applies to some, but not other elements for this property. See `SchemaProperty.hasNillable()```, `SchemaProperty.hasDefault()```, `SchemaProperty.hasFixed()```

### XML_OBJECT

    public static final int XML_OBJECT

  An XML Bean type that inherits from `XmlObject```. See `SchemaProperty.getJavaTypeCode()```.

## Method Detail

### acceptedNames() Method

    public QName[] acceptedNames()

For element properties the set of names that are accepted for this property if this element is the head of a substitution group. This will always have at least one element, ie, the property's name.

### extendsJavaArray() Method

    public boolean extendsJavaArray()

True if there is a Java getter that returns an array.

### extendsJavaOption() Method

    public boolean extendsJavaOption()

True if there is an Java isSet method that tests for presence.

### extendsJavaSingleton() Method

    public boolean extendsJavaSingleton()

True if there is a Java getter that returns a singleton.

### getContainerType() Method

    public SchemaType getContainerType()

The type within which this property appears

### getDefaultText() Method

    public String getDefaultText()

Returns the default or fixed value, if it is consistent. If it is not consistent, then returns null. See `SchemaProperty.hasDefault()``` and `SchemaProperty.hasFixed()```.

### getDefaultValue() Method

    public XmlAnySimpleType getDefaultValue()

Returns the default or fixed value as a strongly-typed value, if it is consistent. If it is not consistent, then returns null. See `SchemaProperty.hasDefault()``` and `SchemaProperty.hasFixed()```.

### getJavaPropertyName() Method

    public String getJavaPropertyName()

The Java name for this property. For example, if the method to access this property is called getFirstName, then this method returns the string "FirstName". May be null if the schema type has not been compiled to Java.

### getJavaSetterDelimiter() Method

    public QNameSet getJavaSetterDelimiter()

Returns the set of element names which should appear strictly after all occurences of the elements described by this property. For element properties only.

### getJavaTypeCode() Method

    public int getJavaTypeCode()

Returns the natural Java type for this property. Returns either XML_OBJECT (for complex types) or one of the JAVA_* constants described in this interface.

### getMaxOccurs() Method

    public BigInteger getMaxOccurs()

Returns a summarized minimum occurrance number. For example, a sequence containing a nonoptional singleton element repeated twice will result in a property getMaxOccurs() of 2.

### getMinOccurs() Method

    public BigInteger getMinOccurs()

Returns a summarized minimum occurrance number. For example, a sequence containing a nonoptional singleton element repeated twice will result in a property getMinOccurs() of 2.

### getName() Method

    public QName getName()

The name of this element or attribute

### getType() Method

    public SchemaType getType()

The schema type for the property.

### hasDefault() Method

    public int hasDefault()

Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` defaulted, depending on the defaults present in the elements in this property.

### hasFixed() Method

    public int hasFixed()

Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` fixed, depending on the fixed constraints present in the elements in this property.

### hasNillable() Method

    public int hasNillable()

Returns `SchemaProperty.NEVER```, `SchemaProperty.VARIABLE```, or `SchemaProperty.CONSISTENTLY``` nillable, depending on the nillability of the elements in this property.

### isAttribute() Method

    public boolean isAttribute()

True for attributes.

### isReadOnly() Method

    public boolean isReadOnly()

True for read-only properties.

### javaBasedOnType() Method

    public SchemaType javaBasedOnType()

The schema type returned from the Java getter for this property. Applies only to types that have been code generated to Java; may be a base type of getType().