public abstract class Type extends NamedObject implements Attributable
This abstract class contains the implementation of attributes and attributes groups.
| Modifier and Type | Field and Description |
|---|---|
protected AnyAttribute |
anyAttributeElement |
protected List |
appinfo |
protected HashMap |
attributeElementGroups |
protected HashMap |
attributeElements |
protected List |
documentation |
protected HashMap |
knownSubtypes |
abstractValue, nameATTRIBUTE_NAME, ATTRIBUTE_TYPE, ATTRIBUTE_VALUE_FALSE, ATTRIBUTE_VALUE_TRUE, TAG_ANY, TAG_ANYATTRIBUTEATTRIBUTE_ABSTRACT, ATTRIBUTE_DEFAULT, ATTRIBUTE_FIXED, ATTRIBUTE_USE, ATTRIBUTE_XSINIL, ATTRIBUTE_XSINIL_QUALIFIED, ATTRIBUTE_XSITYPE, ATTRIBUTE_XSITYPE_QUALIFIED, DOCUMENTATION_LANG, DOCUMENTATION_LANG_QUALIFIED, ELEMENT_ALL, ELEMENT_ALL_QUALIFIED, ELEMENT_CHOICE, ELEMENT_CHOICE_QUALIFIED, ELEMENT_DEFAULT, ELEMENT_DEFAULT_QUALIFIED, ELEMENT_FIXED, ELEMENT_FIXED_QUALIFIED, ELEMENT_MAXOCCURS, ELEMENT_MINOCCURS, ELEMENT_NILLABLE, ELEMENT_PARENT, ELEMENT_PARENT_QUALIFIED, ELEMENT_RESTRICTIONS, ELEMENT_SEQUENCE, ELEMENT_SEQUENCE_QUALIFIED, ELEMENT_SUBSTITUTIONS, ELEMENT_UNIONS, FACET_ENUMERATION, FACET_ENUMERATION_QUALIFIED, FACET_FRACTIONDIGITS, FACET_FRACTIONDIGITS_QUALIFIED, FACET_LENGTH, FACET_LENGTH_QUALIFIED, FACET_MAXEXCLUSIVE, FACET_MAXEXCLUSIVE_QUALIFIED, FACET_MAXINCLUSIVE, FACET_MAXINCLUSIVE_QUALIFIED, FACET_MAXLENGTH, FACET_MAXLENGTH_QUALIFIED, FACET_MINEXCLUSIVE, FACET_MINEXCLUSIVE_QUALIFIED, FACET_MININCLUSIVE, FACET_MININCLUSIVE_QUALIFIED, FACET_MINLENGTH, FACET_MINLENGTH_QUALIFIED, FACET_PATTERN, FACET_PATTERN_QUALIFIED, FACET_TOTALDIGITS, FACET_TOTALDIGITS_QUALIFIED, FACET_WHITESPACE, FACET_WHITESPACE_QUALIFIED, LIST_ITEMTYPE, MAXOCCURS_UNBOUNDED, SCHEMA_ANNOTATION, SCHEMA_ANNOTATION_QUALIFIED, SCHEMA_ANY, SCHEMA_ANY_QUALIFIED, SCHEMA_ANYATTRIBUTE, SCHEMA_ANYATTRIBUTE_QUALIFIED, SCHEMA_APP_INFO, SCHEMA_APP_INFO_QUALIFIED, SCHEMA_ATTRIBUTE, SCHEMA_ATTRIBUTE_QUALIFIED, SCHEMA_ATTRIBUTEFORMDEFAULT, SCHEMA_ATTRIBUTEFORMDEFAULT_QUALIFIED, SCHEMA_ATTRIBUTEGROUP, SCHEMA_ATTRIBUTEGROUP_QUALIFIED, SCHEMA_BASE, SCHEMA_BASE_QUALIFIED, SCHEMA_COMPLEXCONTENT, SCHEMA_COMPLEXCONTENT_QUALIFIED, SCHEMA_COMPLEXTYPE, SCHEMA_COMPLEXTYPE_QUALIFIED, SCHEMA_DOCUMENTATION, SCHEMA_DOCUMENTATION_QUALIFIED, SCHEMA_ELEMENT, SCHEMA_ELEMENT_QUALIFIED, SCHEMA_ELEMENTFORMDEFAULT, SCHEMA_ELEMENTFORMDEFAULT_QUALIFIED, SCHEMA_EXTENSION, SCHEMA_EXTENSION_QUALIFIED, SCHEMA_FACETS, SCHEMA_FORM, SCHEMA_FORM_QUALIFIED, SCHEMA_GROUP, SCHEMA_GROUP_QUALIFIED, SCHEMA_IMPORT, SCHEMA_IMPORT_QUALIFIED, SCHEMA_INCLUDE, SCHEMA_INCLUDE_QUALIFIED, SCHEMA_ITEMLIST, SCHEMA_ITEMLIST_QUALIFIED, SCHEMA_ITEMTYPE, SCHEMA_ITEMTYPE_QUALIFIED, SCHEMA_LIST, SCHEMA_LIST_QUALIFIED, SCHEMA_LOCATION, SCHEMA_LOCATION_QUALIFIED, SCHEMA_MEMBERTYPES, SCHEMA_MEMBERTYPES_QUALIFIED, SCHEMA_NAME, SCHEMA_NAME_QUALIFIED, SCHEMA_NAMESPACE, SCHEMA_NAMESPACE_QUALIFIED, SCHEMA_NONAMESPACESCHEMALOCATION, SCHEMA_NONAMESPACESCHEMALOCATION_QUALIFIED, SCHEMA_NOTATION, SCHEMA_NOTATION_QUALIFIED, SCHEMA_PUBLIC, SCHEMA_PUBLIC_QUALIFIED, SCHEMA_QUALIFIED, SCHEMA_QUALIFIED_QUALIFIED, SCHEMA_REDEFINE, SCHEMA_REDEFINE_QUALIFIED, SCHEMA_REF, SCHEMA_REF_QUALIFIED, SCHEMA_RESTRICTION, SCHEMA_RESTRICTION_QUALIFIED, SCHEMA_SCHEMA, SCHEMA_SCHEMA_QUALIFIED, SCHEMA_SIMPLECONTENT, SCHEMA_SIMPLECONTENT_QUALIFIED, SCHEMA_SIMPLETYPE, SCHEMA_SIMPLETYPE_QUALIFIED, SCHEMA_STYPES, SCHEMA_SUBSTITUTIONGROUP, SCHEMA_SUBSTITUTIONGROUP_QUALIFIED, SCHEMA_SYSTEM, SCHEMA_SYSTEM_QUALIFIED, SCHEMA_TARGETNAMESPACE, SCHEMA_TARGETNAMESPACE_QUALIFIED, SCHEMA_TYPE, SCHEMA_TYPE_QUALIFIED, SCHEMA_UNION, SCHEMA_UNION_QUALIFIED, SCHEMA_UNQUALIFIED, SCHEMA_UNQUALIFIED_QUALIFIED, SCHEMA_VALUE, SCHEMA_VALUE_QUALIFIED, SCHEMA_VALUEVECTOR, SCHEMA_VALUEVECTOR_QUALIFIED, USE_OPTIONAL, USE_PROHIBITED, USE_REQUIRED, XMLSCHEMA_NAMESPACE, XMLSCHEMA_PREFIX, XSD_ALLMODEL, XSD_ANYATTRIBUTE, XSD_ANYELEMENT, XSD_ATTRIBUTE, XSD_ATTRIBUTEGROUP, XSD_CHOICEMODEL, XSD_COMPLEXTYPE, XSD_ELEMENT, XSD_EXTENDEDCOMPLEXCONTENT, XSD_EXTENDEDSIMPLECONTENT, XSD_GROUP, XSD_NOTATION, XSD_RESTRICTEDCOMPLEXCONTENT, XSD_RESTRICTEDSIMPLECONTENT, XSD_RESTRICTEDSIMPLETYPE, XSD_SCHEMA, XSD_SEQUENCEMODEL, XSD_SIMPLETYPE, XSI_NAMESPACE, XSI_PREFIX| Modifier and Type | Method and Description |
|---|---|
protected void |
addAppInfo(java.lang.String documentation) |
void |
addAttributeElement(Attribute a)
Adds an attribute to this type.
|
void |
addAttributeElementGroup(AttributeGroup g)
Adds an attribute group to this type.
|
protected void |
addDocumentation(java.lang.String documentation) |
Iterator |
allAttributeElements()
Returns the attributes for this type, even from attribute groups.
|
void |
allowAnyAttributeElement()
This will add the possibility to add any attribute from other schema to this type.
|
Iterator |
attributeElementGroups()
Returns the attribute groups for this type.
|
Iterator |
attributeElements()
Returns the attributes for this type.
|
void |
denyAnyAttributeElement()
This will remove the possibility to add any attribute from other schema to this type.
|
protected Iterator |
getAppInfos() |
CustomAttributeValue |
getAttribute(QName name)
Returns the value of the attribute with the given
name or null, if
this attribute is not available (or if its value is actually explicitly set to null
). |
Attribute |
getAttributeElement(QName name)
Returns an attribute with matching qualified name.
|
int |
getAttributeElementCount()
Returns the number of attributes for this type.
|
AttributeGroup |
getAttributeElementGroup(QName name)
Returns an attribute group by qualified name.
|
int |
getAttributeElementGroupCount()
Returns the amount of attribute groups for this type.
|
HashMap |
getAttributes()
Returns all attributes explicitly set for this
Attributable instance. |
protected Iterator |
getDocumentations() |
Iterator |
getKownSubtypes()
Returns an iterator which contains all known types extending this type.
|
static int |
getTypeCount()
Returns the number of created types.
|
boolean |
hasAnyAttributeElement()
Returns whether this type can contain attributes not defined by the schema.
|
boolean |
hasAttributeElementGroups()
Returns
true if the type contains attribute groups, false otherwise. |
boolean |
hasAttributeElements()
Returns
true if the type contains attributes, false otherwise. |
boolean |
hasAttributes()
Returns
true only if this instance has at least one attribute set. |
static void |
incrementTypeCount() |
boolean |
isComplexType() |
protected void |
serializeAnyAttributeElement(XmlSerializer serializer,
Schema schema) |
protected void |
serializeAttributeElementGroups(XmlSerializer serializer,
Schema schema) |
protected void |
serializeAttributeElements(XmlSerializer serializer,
Schema schema) |
void |
serializeAttributes(XmlSerializer serializer)
Serializes the attributes stored within this instance, if any.
|
void |
setAttribute(QName name,
CustomAttributeValue value)
Sets the
value for the attribute with the specified name. |
void |
setAttribute(QName name,
java.lang.String value)
Sets the
value for the attribute with the specified name. |
void |
setAttributes(HashMap attributes)
Sets all attributes at once to those contained within argument
attributes. |
checkNamespace, equals, getName, getParentSchema, hashCode, isAbstract, setAbstract, setName, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSchemaIdentifierprotected HashMap attributeElements
protected HashMap attributeElementGroups
protected HashMap knownSubtypes
protected AnyAttribute anyAttributeElement
protected List documentation
protected List appinfo
public static int getTypeCount()
Use this for debug purposes.
public static void incrementTypeCount()
public boolean isComplexType()
public Iterator getKownSubtypes()
Type objects).public boolean hasAttributeElements()
true if the type contains attributes, false otherwise.true if the type contains attributes, false otherwise.public boolean hasAttributeElementGroups()
true if the type contains attribute groups, false otherwise.true if the type contains attribute groups, false otherwise.public void addAttributeElement(Attribute a)
a - the attribute to add.public Attribute getAttributeElement(QName name)
name - the qualified name for the attribute.public int getAttributeElementCount()
public Iterator attributeElements()
public void addAttributeElementGroup(AttributeGroup g)
g - the attribute group to add.public AttributeGroup getAttributeElementGroup(QName name)
name - the qualified name for the attribute group.public int getAttributeElementGroupCount()
public Iterator attributeElementGroups()
public Iterator allAttributeElements()
public boolean hasAnyAttributeElement()
true if any attribute can be added to this type, false otherwise.public void allowAnyAttributeElement()
public void denyAnyAttributeElement()
protected void serializeAttributeElements(XmlSerializer serializer, Schema schema) throws java.io.IOException
java.io.IOExceptionprotected void serializeAttributeElementGroups(XmlSerializer serializer, Schema schema) throws java.io.IOException
java.io.IOExceptionprotected void serializeAnyAttributeElement(XmlSerializer serializer, Schema schema) throws java.io.IOException
java.io.IOExceptionpublic CustomAttributeValue getAttribute(QName name)
Attributablename or null, if
this attribute is not available (or if its value is actually explicitly set to null
).getAttribute in interface Attributablename - the name of the attribute of which to query the valuenullpublic void setAttribute(QName name, CustomAttributeValue value)
Attributablevalue for the attribute with the specified name. Throws a
java.lang.IllegalArgumentException in case name is null.setAttribute in interface Attributablename - the name of the attribute to set, must not be nullvalue - the value to set the named attribute to (may be nullpublic void setAttribute(QName name, java.lang.String value)
Attributablevalue for the attribute with the specified name. The value
will be represented as plain String. It will be wrapped within a new instance of StringAttributeValue. This method throws a java.lang.IllegalArgumentException in
case name is null.
This is a shorthand for setAttribute(name, new StringAttributeValue(value)).
setAttribute in interface Attributablename - the name of the attribute to set, must not be nullvalue - the value to set the named attribute to (may be nullpublic HashMap getAttributes()
AttributableAttributable instance. Note that
depending on the actual implementation the returned reference may point at the 'life map', i
.e. the actual storage for the attributes. Thus, modifications to that map should be performed
with care and keeping this in mind.getAttributes in interface Attributablepublic void setAttributes(HashMap attributes)
Attributableattributes. Note
that depending on the actual implementation it is possible that the map attributes
points at may be used for the actual internal storage of the attributes (i.e. without copying
it). That is why, after passing it to this method, modifications to this map should be made
with care. This method throws a java.lang.IllegalArgumentException in cases where
attributes is null.setAttributes in interface Attributableattributes - the new attributes to setpublic boolean hasAttributes()
Attributabletrue only if this instance has at least one attribute set. Returns
false in any other case.hasAttributes in interface Attributabletrue only if there is at least one attribute set within this instancepublic void serializeAttributes(XmlSerializer serializer) throws java.io.IOException
AttributableserializeAttributes in interface Attributableserializer - the serializer to which to send outputjava.io.IOException - in case writing to serializer fails for any reasonprotected void addDocumentation(java.lang.String documentation)
protected Iterator getDocumentations()
protected void addAppInfo(java.lang.String documentation)
protected Iterator getAppInfos()