org.ws4d.java.schema
Class Type

java.lang.Object
  extended by org.ws4d.java.schema.NamedObject
      extended by org.ws4d.java.schema.Type
All Implemented Interfaces:
SchemaConstants, Any
Direct Known Subclasses:
ComplexType, RestrictedSimpleType, SimpleType

public abstract class Type
extends NamedObject

Abstract class for object representation of XML Schema types.

This abstract class contains the implementation of attributes and attributes groups.


Field Summary
 
Fields inherited from interface org.ws4d.java.schema.Any
ATTRIBUTE_NAME, ATTRIBUTE_TYPE, ATTRIBUTE_VALUE_FALSE, ATTRIBUTE_VALUE_TRUE, TAG_ANY, TAG_ANYATTRIBUTE
 
Fields inherited from interface org.ws4d.java.constants.SchemaConstants
ATTRIBUTE_ABSTRACT, ATTRIBUTE_DEFAULT, ATTRIBUTE_FIXED, ATTRIBUTE_USE, ATTRIBUTE_XSINIL, ATTRIBUTE_XSITYPE, DOCUMENTATION_LANG, ELEMENT_ALL, ELEMENT_CHOICE, ELEMENT_DEFAULT, ELEMENT_FIXED, ELEMENT_MAXOCCURS, ELEMENT_MINOCCURS, ELEMENT_NILLABLE, ELEMENT_PARENT, ELEMENT_RESTRICTIONS, ELEMENT_SEQUENCE, ELEMENT_SUBSTITUTIONS, ELEMENT_UNIONS, FACET_ENUMERATION, FACET_FRACTIONDIGITS, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_PATTERN, FACET_TOTALDIGITS, FACET_WHITESPACE, LIST_ITEMTYPE, MAXOCCURS_UNBOUNDED, SCHEMA_ANNOTATION, SCHEMA_ANY, SCHEMA_ANYATTRIBUTE, SCHEMA_APP_INFO, SCHEMA_ATTRIBUTE, SCHEMA_ATTRIBUTEFORMDEFAULT, SCHEMA_ATTRIBUTEGROUP, SCHEMA_BASE, SCHEMA_COMPLEXCONTENT, SCHEMA_COMPLEXTYPE, SCHEMA_DOCUMENTATION, SCHEMA_ELEMENT, SCHEMA_ELEMENTFORMDEFAULT, SCHEMA_EXTENSION, SCHEMA_FACETS, SCHEMA_FORM, SCHEMA_GROUP, SCHEMA_IMPORT, SCHEMA_INCLUDE, SCHEMA_ITEMLIST, SCHEMA_ITEMTYPE, SCHEMA_LIST, SCHEMA_LOCATION, SCHEMA_MEMBERTYPES, SCHEMA_NAME, SCHEMA_NAMESPACE, SCHEMA_NONAMESPACESCHEMALOCATION, SCHEMA_NOTATION, SCHEMA_PUBLIC, SCHEMA_QUALIFIED, SCHEMA_REDEFINE, SCHEMA_REF, SCHEMA_RESTRICTION, SCHEMA_SCHEMA, SCHEMA_SIMPLECONTENT, SCHEMA_SIMPLETYPE, SCHEMA_STYPES, SCHEMA_SUBSTITUTIONGROUP, SCHEMA_SYSTEM, SCHEMA_TARGETNAMESPACE, SCHEMA_TYPE, SCHEMA_UNION, SCHEMA_UNQUALIFIED, SCHEMA_VALUE, SCHEMA_VALUEVECTOR, 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
 
Method Summary
 void addAttribute(Attribute a)
          Adds an attribute to this type.
 void addAttributeGroup(AttributeGroup g)
          Adds an attribute group to this type.
 Iterator allAttributes()
          Returns the attributes for this type, even from attribute groups.
 void allowAnyAttribute()
          This will add the possibility to add any attribute from other schema to this type.
 Iterator attributeGroups()
          Returns the attribute groups for this type.
 Iterator attributes()
          Returns the attributes for this type.
 void denyAnyAttribute()
          This will remove the possibility to add any attribute from other schema to this type.
 Attribute getAttribute(QName name)
          Returns an attribute with matching qualified name.
 int getAttributeCount()
          Returns the number of attributes for this type.
 AttributeGroup getAttributeGroup(QName name)
          Returns an attribute group by qualified name.
 int getAttributeGroupCount()
          Returns the amount of attribute groups for this type.
 Iterator getKownSubtypes()
          Returns an iterator which contains all known types extending this type.
static int getTypeCount()
          Returns the number of created types.
 boolean hasAnyAttribute()
          Returns whether this type can contain attributes not defined by the schema.
 boolean hasAttributeGroups()
          Returns true if the type contains attribute groups, false otherwise.
 boolean hasAttributes()
          Returns true if the type contains attributes, false otherwise.
 boolean isComplexType()
           
 
Methods inherited from class org.ws4d.java.schema.NamedObject
checkNamespace, equals, getName, getParentSchema, hashCode, isAbstract, setAbstract, setName, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ws4d.java.schema.Any
getSchemaIdentifier
 

Method Detail

getTypeCount

public static int getTypeCount()
Returns the number of created types.

Use this for debug purposes.

Returns:
number of created types.

isComplexType

public boolean isComplexType()

getKownSubtypes

public Iterator getKownSubtypes()
Returns an iterator which contains all known types extending this type.

Returns:
the iterator (with Type objects).

hasAttributes

public boolean hasAttributes()
Returns true if the type contains attributes, false otherwise.

Returns:
true if the type contains attributes, false otherwise.

hasAttributeGroups

public boolean hasAttributeGroups()
Returns true if the type contains attribute groups, false otherwise.

Returns:
true if the type contains attribute groups, false otherwise.

addAttribute

public void addAttribute(Attribute a)
Adds an attribute to this type.

Parameters:
a - the attribute to add.

getAttribute

public Attribute getAttribute(QName name)
Returns an attribute with matching qualified name.

Parameters:
name - the qualified name for the attribute.
Returns:
the attribute.

getAttributeCount

public int getAttributeCount()
Returns the number of attributes for this type.

Returns:
the number of attributes for this type.

attributes

public Iterator attributes()
Returns the attributes for this type.

Returns:
the attributes.

addAttributeGroup

public void addAttributeGroup(AttributeGroup g)
Adds an attribute group to this type.

Parameters:
g - the attribute group to add.

getAttributeGroup

public AttributeGroup getAttributeGroup(QName name)
Returns an attribute group by qualified name.

Parameters:
name - the qualified name for the attribute group.
Returns:
the attribute group.

getAttributeGroupCount

public int getAttributeGroupCount()
Returns the amount of attribute groups for this type.

Returns:
the amount of attribute groups for this type.

attributeGroups

public Iterator attributeGroups()
Returns the attribute groups for this type.

Returns:
the attribute groups.

allAttributes

public Iterator allAttributes()
Returns the attributes for this type, even from attribute groups.

Returns:
the attributes.

hasAnyAttribute

public boolean hasAnyAttribute()
Returns whether this type can contain attributes not defined by the schema.

Returns:
true if any attribute can be added to this type, false otherwise.

allowAnyAttribute

public void allowAnyAttribute()
This will add the possibility to add any attribute from other schema to this type.


denyAnyAttribute

public void denyAnyAttribute()
This will remove the possibility to add any attribute from other schema to this type.