Package org.apache.xmlbeans
Interface SchemaProperty
- All Known Implementing Classes:
SchemaPropertyImpl
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Applies to all elements for this property.static final int
ABigDecimal
.static final int
ABigInteger
.static final int
A Java boolean.static final int
A Java byte.static final int
A byte[].static final int
ACalendar
.static final int
ADate
.static final int
A Java double.static final int
A generatedStringEnumAbstractBase
subclass.static final int
Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.static final int
A Java float.static final int
AGDate
.static final int
AGDuration
.static final int
A Java int.static final int
Java primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.static final int
AList
.static final int
A Java long.static final int
AObject
, used for some simple type unions.static final int
AQName
.static final int
A Java short.static final int
AString
.static final int
A user specified type.static final int
Applies to no elements for this property.static final int
Applies to some, but not other elements for this property.static final int
An XML Bean type that inherits fromXmlObject
. -
Method Summary
Modifier and TypeMethodDescriptionQName[]
For element properties the set of names that are accepted for this property if this element is the head of a substitution group.boolean
True if there is a Java getter that returns an array.boolean
True if there is an Java isSet method that tests for presence.boolean
True if there is a Java getter that returns a singleton.The type within which this property appearsReturns the default or fixed value, if it is consistent.Returns the default or fixed value as a strongly-typed value, if it is consistent.return user specified documentationThe Java name for this property.Returns the set of element names which should appear strictly after all occurences of the elements described by this property.int
Returns the natural Java type for this property.Returns a summarized minimum occurrance number.Returns a summarized minimum occurrance number.getName()
The name of this element or attributegetType()
The schema type for the property.int
ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
defaulted, depending on the defaults present in the elements in this property.int
hasFixed()
ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
fixed, depending on the fixed constraints present in the elements in this property.int
ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
nillable, depending on the nillability of the elements in this property.boolean
True for attributes.boolean
True for read-only properties.The schema type returned from the Java getter for this property.void
setDocumentation
(String documentation)
-
Field Details
-
NEVER
static final int NEVER- See Also:
-
VARIABLE
static final int VARIABLEApplies to some, but not other elements for this property. SeehasNillable()
,hasDefault()
,hasFixed()
- See Also:
-
CONSISTENTLY
static final int CONSISTENTLY- See Also:
-
XML_OBJECT
static final int XML_OBJECTAn XML Bean type that inherits fromXmlObject
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_FIRST_PRIMITIVE
static final int JAVA_FIRST_PRIMITIVEJava primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.- See Also:
-
JAVA_BOOLEAN
static final int JAVA_BOOLEANA Java boolean. SeegetJavaTypeCode()
.- See Also:
-
JAVA_FLOAT
static final int JAVA_FLOATA Java float. SeegetJavaTypeCode()
.- See Also:
-
JAVA_DOUBLE
static final int JAVA_DOUBLEA Java double. SeegetJavaTypeCode()
.- See Also:
-
JAVA_BYTE
static final int JAVA_BYTEA Java byte. SeegetJavaTypeCode()
.- See Also:
-
JAVA_SHORT
static final int JAVA_SHORTA Java short. SeegetJavaTypeCode()
.- See Also:
-
JAVA_INT
static final int JAVA_INTA Java int. SeegetJavaTypeCode()
.- See Also:
-
JAVA_LONG
static final int JAVA_LONGA Java long. SeegetJavaTypeCode()
.- See Also:
-
JAVA_LAST_PRIMITIVE
static final int JAVA_LAST_PRIMITIVEJava primitive type codes (for non-nullable Java types) are between JAVA_FIRST_PRIMITIVE and JAVA_LAST_PRIMITIVE, inclusive.- See Also:
-
JAVA_BIG_DECIMAL
static final int JAVA_BIG_DECIMALABigDecimal
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_BIG_INTEGER
static final int JAVA_BIG_INTEGERABigInteger
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_STRING
static final int JAVA_STRINGAString
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_BYTE_ARRAY
static final int JAVA_BYTE_ARRAYA byte[]. SeegetJavaTypeCode()
.- See Also:
-
JAVA_GDATE
static final int JAVA_GDATEAGDate
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_GDURATION
static final int JAVA_GDURATIONAGDuration
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_DATE
static final int JAVA_DATEADate
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_QNAME
static final int JAVA_QNAMEAQName
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_LIST
static final int JAVA_LISTAList
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_CALENDAR
static final int JAVA_CALENDARACalendar
. SeegetJavaTypeCode()
.- See Also:
-
JAVA_ENUM
static final int JAVA_ENUMA generatedStringEnumAbstractBase
subclass. SeegetJavaTypeCode()
.- See Also:
-
JAVA_OBJECT
static final int JAVA_OBJECTAObject
, used for some simple type unions. SeegetJavaTypeCode()
.- See Also:
-
JAVA_USER
static final int JAVA_USERA user specified type.- See Also:
-
-
Method Details
-
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()ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
nillable, depending on the nillability of the elements in this property. -
hasDefault
int hasDefault()ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
defaulted, depending on the defaults present in the elements in this property. -
hasFixed
int hasFixed()ReturnsNEVER
,VARIABLE
, orCONSISTENTLY
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. SeehasDefault()
andhasFixed()
. -
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. SeehasDefault()
andhasFixed()
. -
getDocumentation
String getDocumentation()return user specified documentation -
setDocumentation
-