org.apache.xmlbeans
Interface SchemaProperty


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.

See Also:
SchemaType.getProperties(), SchemaType.getAttributeProperties(), SchemaType.getElementProperties(), SchemaType.getAttributeProperty(javax.xml.namespace.QName), SchemaType.getElementProperty(javax.xml.namespace.QName)

Field Summary
static int CONSISTENTLY
          Applies to all elements for this property.
static int JAVA_BIG_DECIMAL
          A BigDecimal.
static int JAVA_BIG_INTEGER
          A BigInteger.
static int JAVA_BOOLEAN
          A Java boolean.
static int JAVA_BYTE
          A Java byte.
static int JAVA_BYTE_ARRAY
          A byte[].
static int JAVA_CALENDAR
          A Calendar.
static int JAVA_DATE
          A Date.
static int JAVA_DOUBLE
          A Java double.
static int JAVA_ENUM
          A generated StringEnumAbstractBase subclass.
static int JAVA_FIRST_PRIMITIVE
          Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.
static int JAVA_FLOAT
          A Java float.
static int JAVA_GDATE
          A GDate.
static int JAVA_GDURATION
          A GDuration.
static int JAVA_INT
          A Java int.
static int JAVA_LAST_PRIMITIVE
          Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.
static int JAVA_LIST
          A List.
static int JAVA_LONG
          A Java long.
static int JAVA_OBJECT
          A Object, used for some simple type unions.
static int JAVA_QNAME
          A QName.
static int JAVA_SHORT
          A Java short.
static int JAVA_STRING
          A String.
static int JAVA_USER
          A user specified type.
static int NEVER
          Applies to no elements for this property.
static int VARIABLE
          Applies to some, but not other elements for this property.
static int XML_OBJECT
          An XML Bean type that inherits from XmlObject.
 
Method Summary
 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.
 boolean extendsJavaArray()
          True if there is a Java getter that returns an array.
 boolean extendsJavaOption()
          True if there is an Java isSet method that tests for presence.
 boolean extendsJavaSingleton()
          True if there is a Java getter that returns a singleton.
 SchemaType getContainerType()
          The type within which this property appears
 String getDefaultText()
          Returns the default or fixed value, if it is consistent.
 XmlAnySimpleType getDefaultValue()
          Returns the default or fixed value as a strongly-typed value, if it is consistent.
 String getJavaPropertyName()
          The Java name for this property.
 QNameSet getJavaSetterDelimiter()
          Returns the set of element names which should appear strictly after all occurences of the elements described by this property.
 int getJavaTypeCode()
          Returns the natural Java type for this property.
 BigInteger getMaxOccurs()
          Returns a summarized minimum occurrance number.
 BigInteger getMinOccurs()
          Returns a summarized minimum occurrance number.
 QName getName()
          The name of this element or attribute
 SchemaType getType()
          The schema type for the property.
 int hasDefault()
          Returns NEVER, VARIABLE, or CONSISTENTLY defaulted, depending on the defaults present in the elements in this property.
 int hasFixed()
          Returns NEVER, VARIABLE, or CONSISTENTLY fixed, depending on the fixed constraints present in the elements in this property.
 int hasNillable()
          Returns NEVER, VARIABLE, or CONSISTENTLY nillable, depending on the nillability of the elements in this property.
 boolean isAttribute()
          True for attributes.
 boolean isReadOnly()
          True for read-only properties.
 SchemaType javaBasedOnType()
          The schema type returned from the Java getter for this property.
 

Field Detail

NEVER

static final int NEVER
Applies to no elements for this property. See hasNillable(), hasDefault(), hasFixed()

See Also:
Constant Field Values

VARIABLE

static final int VARIABLE
Applies to some, but not other elements for this property. See hasNillable(), hasDefault(), hasFixed()

See Also:
Constant Field Values

CONSISTENTLY

static final int CONSISTENTLY
Applies to all elements for this property. See hasNillable(), hasDefault(), hasFixed()

See Also:
Constant Field Values

XML_OBJECT

static final int XML_OBJECT
An XML Bean type that inherits from XmlObject. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_FIRST_PRIMITIVE

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.

See Also:
Constant Field Values

JAVA_BOOLEAN

static final int JAVA_BOOLEAN
A Java boolean. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_FLOAT

static final int JAVA_FLOAT
A Java float. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_DOUBLE

static final int JAVA_DOUBLE
A Java double. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_BYTE

static final int JAVA_BYTE
A Java byte. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_SHORT

static final int JAVA_SHORT
A Java short. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_INT

static final int JAVA_INT
A Java int. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_LONG

static final int JAVA_LONG
A Java long. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_LAST_PRIMITIVE

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.

See Also:
Constant Field Values

JAVA_BIG_DECIMAL

static final int JAVA_BIG_DECIMAL
A BigDecimal. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_BIG_INTEGER

static final int JAVA_BIG_INTEGER
A BigInteger. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_STRING

static final int JAVA_STRING
A String. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_BYTE_ARRAY

static final int JAVA_BYTE_ARRAY
A byte[]. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_GDATE

static final int JAVA_GDATE
A GDate. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_GDURATION

static final int JAVA_GDURATION
A GDuration. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_DATE

static final int JAVA_DATE
A Date. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_QNAME

static final int JAVA_QNAME
A QName. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_LIST

static final int JAVA_LIST
A List. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_CALENDAR

static final int JAVA_CALENDAR
A Calendar. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_ENUM

static final int JAVA_ENUM
A generated StringEnumAbstractBase subclass. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_OBJECT

static final int JAVA_OBJECT
A Object, used for some simple type unions. See getJavaTypeCode().

See Also:
Constant Field Values

JAVA_USER

static final int JAVA_USER
A user specified type.

See Also:
Constant Field Values
Method Detail

getContainerType

SchemaType getContainerType()
The type within which this property appears


getName

QName getName()
The name of this element or attribute


acceptedNames

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.


getJavaPropertyName

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.


isReadOnly

boolean isReadOnly()
True for read-only properties.


isAttribute

boolean isAttribute()
True for attributes.


getType

SchemaType getType()
The schema type for the property.


javaBasedOnType

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().


extendsJavaSingleton

boolean extendsJavaSingleton()
True if there is a Java getter that returns a singleton.


extendsJavaOption

boolean extendsJavaOption()
True if there is an Java isSet method that tests for presence.


extendsJavaArray

boolean extendsJavaArray()
True if there is a Java getter that returns an array.


getJavaTypeCode

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.


getJavaSetterDelimiter

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.


getMinOccurs

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.


getMaxOccurs

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.


hasNillable

int hasNillable()
Returns NEVER, VARIABLE, or CONSISTENTLY nillable, depending on the nillability of the elements in this property.


hasDefault

int hasDefault()
Returns NEVER, VARIABLE, or CONSISTENTLY defaulted, depending on the defaults present in the elements in this property.


hasFixed

int hasFixed()
Returns NEVER, VARIABLE, or CONSISTENTLY fixed, depending on the fixed constraints present in the elements in this property.


getDefaultText

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


getDefaultValue

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 hasDefault() and hasFixed().