org.jbind.xml.schema.cmp
Class Component

java.lang.Object
  extended byorg.jbind.xml.schema.cmp.Component
All Implemented Interfaces:
IComponent, IHasBindingAttributes, IHasLocation, ISourceInfo
Direct Known Subclasses:
AbstractType, AttrDesc, AttrGroupDecl, AttrGroupRef, Content, IdentityConstraintComponent, Notation

public abstract class Component
extends java.lang.Object
implements IComponent


Constructor Summary
Component(ISourceInfo aSourceInfo, java.lang.String aNamespace, java.lang.String aName)
           
 
Method Summary
 void addSubComponent(IComponent aComponent)
           
 IAnnotation getAnnotation()
           
 IAttribute getBindingAttribute(java.lang.String aName)
          Gets the specified binding attribute.
 IBinding[] getBindings()
           
 IAttribute getDefaultedLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 java.lang.String getDefaultedLocalStringBindingAttribute(java.lang.String aName)
          Gets a string valued defaulted local binding attribute.
 IRef getGlobalRef()
          Gets the reference that identifies the component.
 IAttribute getLocalBindingAttribute(java.lang.String aName)
          Gets a local binding attribute.
 java.lang.String getLocalStringBindingAttribute(java.lang.String aName)
          Gets a string valued local binding attribute.
 ILocation getLocation()
           
 java.lang.String getName()
          Gets the name.
 java.lang.String getNamespace()
          Gets the namespace.
 IComponent getParentComponent()
           
 java.util.Map getPrefixToNamespaceMapping()
           
 java.lang.String getStringBindingAttribute(java.lang.String aName)
          Gets a string valued binding attribute.
 boolean isAnonymous()
          Checks if the component is anonymous.
 boolean isTopLevelComponent()
          Checks if the component is a top level component.
 void setBindings(IBinding[] aBindings)
           
 void setParentComponent(IComponent aParent)
           
protected  void visitSubComponents(IComponentVisitor aVisitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbind.xml.core.cmp.IComponent
accept, getSymbolspace, isReference, validate
 

Constructor Detail

Component

public Component(ISourceInfo aSourceInfo,
                 java.lang.String aNamespace,
                 java.lang.String aName)
Method Detail

getNamespace

public final java.lang.String getNamespace()
Description copied from interface: IComponent
Gets the namespace. A component that is not anonymous has a namespace.

Specified by:
getNamespace in interface IComponent

getName

public final java.lang.String getName()
Description copied from interface: IComponent
Gets the name.

Specified by:
getName in interface IComponent
Returns:
(optional). A component that is not anonymous has a name.

isAnonymous

public final boolean isAnonymous()
Description copied from interface: IComponent
Checks if the component is anonymous.

Specified by:
isAnonymous in interface IComponent
Returns:
Returns true iff the component is anonymous.

getGlobalRef

public final IRef getGlobalRef()
Description copied from interface: IComponent
Gets the reference that identifies the component. This method may only be called if the component is not anonymous.

Specified by:
getGlobalRef in interface IComponent
Returns:
A global reference. (required)

getBindings

public final IBinding[] getBindings()
Specified by:
getBindings in interface IComponent

setBindings

public final void setBindings(IBinding[] aBindings)
Specified by:
setBindings in interface IComponent

getLocation

public ILocation getLocation()
Specified by:
getLocation in interface IHasLocation

getBindingAttribute

public IAttribute getBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets the specified binding attribute. The attribute may be searched in different contexts (for example a schema component may asked its ancestor component and its schema for the specified attribute. The the first occurence is returned.

Specified by:
getBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getLocalBindingAttribute

public IAttribute getLocalBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a local binding attribute.

Specified by:
getLocalBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getDefaultedLocalBindingAttribute

public IAttribute getDefaultedLocalBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a local binding attribute. If the binding attribute is not specified locally then a default value is looked for. Default values can be specified on schema elements. If a schema is included by another schema then the default values of the parent schema are considered too.

Specified by:
getDefaultedLocalBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required)
Returns:
(optional).

getLocalStringBindingAttribute

public final java.lang.String getLocalStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued local binding attribute.

Specified by:
getLocalStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getDefaultedLocalStringBindingAttribute

public final java.lang.String getDefaultedLocalStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued defaulted local binding attribute.

Specified by:
getDefaultedLocalStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getStringBindingAttribute

public final java.lang.String getStringBindingAttribute(java.lang.String aName)
Description copied from interface: IHasBindingAttributes
Gets a string valued binding attribute.

Specified by:
getStringBindingAttribute in interface IHasBindingAttributes
Parameters:
aName - (required).
Returns:
(optional).

getPrefixToNamespaceMapping

public java.util.Map getPrefixToNamespaceMapping()
Specified by:
getPrefixToNamespaceMapping in interface ISourceInfo

isTopLevelComponent

public boolean isTopLevelComponent()
Description copied from interface: IComponent
Checks if the component is a top level component. Top level components are direct children of a schema element or of a redefine element.

Specified by:
isTopLevelComponent in interface IComponent
Returns:
Returns true iff this component is a top level component.

getAnnotation

public IAnnotation getAnnotation()
Specified by:
getAnnotation in interface ISourceInfo

setParentComponent

public void setParentComponent(IComponent aParent)
Specified by:
setParentComponent in interface IComponent

getParentComponent

public IComponent getParentComponent()
Specified by:
getParentComponent in interface IComponent

addSubComponent

public void addSubComponent(IComponent aComponent)
Specified by:
addSubComponent in interface IComponent

visitSubComponents

protected void visitSubComponents(IComponentVisitor aVisitor)
                           throws XmlException
Throws:
XmlException