org.idoox.xml.schema
Class SchemaConstruct

java.lang.Object
  extended byorg.idoox.xml.schema.SchemaConstruct
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Attribute, AttributeGroup, RepeatableSchemaConstruct

public class SchemaConstruct
extends java.lang.Object
implements java.io.Serializable

This class is represents any schema construct.

All other classes for schema constructs should be inherited from this one.

Since:
4.0
See Also:
Serialized Form
Component:
Core

Nested Class Summary
static class SchemaConstruct.ConstructType
          An enumeration type for a schema constructs.
 
Field Summary
protected  org.w3c.dom.Element appInfo
          Deprecated. there can be more than one appInfo, use getAppInfos() and setAppInfos(org.w3c.dom.Element[]) instead
protected  QName name
          The name of the type
protected  SchemaConstruct reference
          If this construct is a reference to another construct, this field contains the referenced one
 
Constructor Summary
protected SchemaConstruct(SchemaConstruct.ConstructType constructType)
          A protected constructor.
protected SchemaConstruct(SchemaConstruct.ConstructType constructType, QName name)
          A protected constructor.
 
Method Summary
 java.lang.Object clone()
          Shallow-clones the schema construct.
 boolean containsInFirst(java.lang.String localName)
           
 void copyFrom(SchemaConstruct anotherConstruct)
          Copies all the information of another construct into this construct.
 org.w3c.dom.Element getAppInfo()
          Returns construct's <appInfo> element.
 org.w3c.dom.Element[] getAppInfos()
          Gets the construct's appinfos.
 SchemaConstruct.ConstructType getConstructType()
          Returns this schema construct's type.
 java.util.Map getFacets()
          Returns a map of facets & extensibility attributes.
 java.lang.String getJavaName()
          Returns the name of member in java.
 QName getName()
          Returns the name of the type.
 SchemaConstruct getParent()
          Returns this schema construct's parent.
 java.util.Map getPrefixNamespaceMapping()
           
 SchemaConstruct getReferencedConstruct()
          If this schema construct is a reference, returns the referenced construct.
 QName parseQName(java.lang.String qname)
           
 void setAppInfo(org.w3c.dom.Element appInfo)
          Sets construct's <appInfo> element.
 void setAppInfos(org.w3c.dom.Element[] appInfos)
          Sets the list of <appInfo> elements
 void setConstructType(SchemaConstruct.ConstructType constructType)
          Sets this schema construct's type.
 void setFacets(java.util.Map facets)
          Sets a map of facets & extensibility attributes.
 void setJavaName(java.lang.String javaName)
          Sets the name of member in java.
 void setName(QName name)
          Sets the name of the type.
 void setParent(SchemaConstruct parent)
          Sets this schema construct's parent.
 void setPrefixNamespaceMapping(java.util.Map prefixNamespaceMap)
           
 void setReferencedConstruct(SchemaConstruct referenced)
          Sets the referenced schema construct.
 java.lang.String toIndentedString()
           
 java.lang.String toIndentedString(int level, java.util.Set alreadyProcessed)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected QName name
The name of the type


reference

protected SchemaConstruct reference
If this construct is a reference to another construct, this field contains the referenced one


appInfo

protected org.w3c.dom.Element appInfo
Deprecated. there can be more than one appInfo, use getAppInfos() and setAppInfos(org.w3c.dom.Element[]) instead

Construct's <appInfo> element

Constructor Detail

SchemaConstruct

protected SchemaConstruct(SchemaConstruct.ConstructType constructType)
A protected constructor.

Parameters:
constructType -

SchemaConstruct

protected SchemaConstruct(SchemaConstruct.ConstructType constructType,
                          QName name)
A protected constructor.

Parameters:
constructType -
name -
Method Detail

getName

public QName getName()
Returns the name of the type.

Returns:
the name of the type

setName

public void setName(QName name)
Sets the name of the type.

Parameters:
name - the new name

getJavaName

public java.lang.String getJavaName()
Returns the name of member in java.

Returns:
the name of member in java

setJavaName

public void setJavaName(java.lang.String javaName)
Sets the name of member in java.

Parameters:
javaName - the name of member in java

getReferencedConstruct

public SchemaConstruct getReferencedConstruct()
If this schema construct is a reference, returns the referenced construct.

Returns:
the referenced construct if this schema construct is a reference, otherwise null.

setReferencedConstruct

public void setReferencedConstruct(SchemaConstruct referenced)
Sets the referenced schema construct.

Parameters:
referenced - the referenced schema construct

getAppInfo

public org.w3c.dom.Element getAppInfo()
Returns construct's <appInfo> element.

Returns:
<appInfo> element (the first one if more are available)

setAppInfo

public void setAppInfo(org.w3c.dom.Element appInfo)
Sets construct's <appInfo> element.

Parameters:
appInfo - construct's <appInfo> element

getAppInfos

public org.w3c.dom.Element[] getAppInfos()
Gets the construct's appinfos.

Returns:
the list of <appInfo or null; returned instances should not be modified

setAppInfos

public void setAppInfos(org.w3c.dom.Element[] appInfos)
Sets the list of <appInfo> elements

Parameters:
appInfos - null of list of DOM elements; note that the value is stored as is, without cloning

getFacets

public java.util.Map getFacets()
Returns a map of facets & extensibility attributes.

Returns:
map [QName -> String] of facets and extensibility attributes

setFacets

public void setFacets(java.util.Map facets)
Sets a map of facets & extensibility attributes.

Parameters:
facets - the map of facets to be set

toIndentedString

public java.lang.String toIndentedString(int level,
                                         java.util.Set alreadyProcessed)

toIndentedString

public java.lang.String toIndentedString()

parseQName

public QName parseQName(java.lang.String qname)
                 throws SchemaException
Throws:
SchemaException

getParent

public SchemaConstruct getParent()
Returns this schema construct's parent.

Returns:
the schema construct's parent

setParent

public void setParent(SchemaConstruct parent)
Sets this schema construct's parent.

Parameters:
parent - the schema construct's parent

getPrefixNamespaceMapping

public java.util.Map getPrefixNamespaceMapping()

setPrefixNamespaceMapping

public void setPrefixNamespaceMapping(java.util.Map prefixNamespaceMap)

getConstructType

public SchemaConstruct.ConstructType getConstructType()
Returns this schema construct's type.

Returns:
this schema construct's type

setConstructType

public void setConstructType(SchemaConstruct.ConstructType constructType)
Sets this schema construct's type.

Parameters:
constructType - the schema construct's parent

clone

public java.lang.Object clone()
Shallow-clones the schema construct.

Returns:
the shallow-clone of the schema construct

copyFrom

public void copyFrom(SchemaConstruct anotherConstruct)
Copies all the information of another construct into this construct.

Parameters:
anotherConstruct - the another construct

containsInFirst

public boolean containsInFirst(java.lang.String localName)