org.jbind.xml.schema.reader
Class Instantiator

java.lang.Object
  extended byorg.jbind.xml.schema.reader.Instantiator
All Implemented Interfaces:
IComponentStore, IInstantiator, ISchemaParser, ISchemaReader

public class Instantiator
extends java.lang.Object
implements IInstantiator, IComponentStore


Constructor Summary
Instantiator(ISchemaParser aParser, IDataImplFactory aDataFactory)
           
 
Method Summary
 void add(IJob aJob)
           
 void addCreatedComponent(IComponent aComponent, IConstraintViolations aViolations)
           
 void addSchemaDataAddition(IComponent aComponent, ISchemaDataAdder anAdder)
          Registers that some schema data has to be added to a component.
 void addValidatedComponent(IComponent aComponent, IConstraintViolations aViolations)
           
 IComponent getComponent(IJobRef aJobRef)
           
 IComponent getComponent(IRef aRef)
          Gets a validated component.
 ISchema getSchema()
          Gets the schema that is instantiated by this instantiator.
 boolean getUseBuiltInClassesOnly()
           
 boolean hasBeenParsed(java.net.URL aUrl)
          Checks if a schema with the specified url has already been parsed by this instantiator.
 IInstantiator newInstantiator()
           
 ISchemaElement parseSchema(java.net.URL aUrl, ISchemaElement aParent)
          Parses a schema doucment.
 ISchema readSchema(java.net.URL aUrl, boolean aUseBuiltInClassesOnly, java.lang.String aPackage)
          Instantiate a schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Instantiator

public Instantiator(ISchemaParser aParser,
                    IDataImplFactory aDataFactory)
Method Detail

newInstantiator

public IInstantiator newInstantiator()
Specified by:
newInstantiator in interface IInstantiator

getSchema

public ISchema getSchema()
Description copied from interface: IInstantiator
Gets the schema that is instantiated by this instantiator.

Specified by:
getSchema in interface IInstantiator
Returns:
(required).

readSchema

public ISchema readSchema(java.net.URL aUrl,
                          boolean aUseBuiltInClassesOnly,
                          java.lang.String aPackage)
                   throws XmlException
Description copied from interface: ISchemaReader
Instantiate a schema.

Specified by:
readSchema in interface ISchemaReader
Parameters:
aUseBuiltInClassesOnly - Determines if only built-in classes are used or if generated classes are also used.
aPackage - (optional) The package of the generated classes. This parameter overloads the package that can be specified in the schema.
Returns:
(required).
Throws:
XmlException

hasBeenParsed

public boolean hasBeenParsed(java.net.URL aUrl)
                      throws XmlException
Description copied from interface: IInstantiator
Checks if a schema with the specified url has already been parsed by this instantiator. This method is used avoid multiple includes / redefines of the same schema document.

Specified by:
hasBeenParsed in interface IInstantiator
Returns:
Returns true iff a schema with the specified URL has already been parsed.
Throws:
XmlException

parseSchema

public ISchemaElement parseSchema(java.net.URL aUrl,
                                  ISchemaElement aParent)
                           throws XmlException
Description copied from interface: ISchemaParser
Parses a schema doucment.

Specified by:
parseSchema in interface ISchemaParser
Parameters:
aUrl - (required).
aParent - (optional).
Returns:
(required).
Throws:
XmlException

getUseBuiltInClassesOnly

public boolean getUseBuiltInClassesOnly()
Specified by:
getUseBuiltInClassesOnly in interface IInstantiator

add

public void add(IJob aJob)
Specified by:
add in interface IInstantiator

addCreatedComponent

public void addCreatedComponent(IComponent aComponent,
                                IConstraintViolations aViolations)
Specified by:
addCreatedComponent in interface IInstantiator

addValidatedComponent

public void addValidatedComponent(IComponent aComponent,
                                  IConstraintViolations aViolations)
Specified by:
addValidatedComponent in interface IInstantiator

getComponent

public IComponent getComponent(IRef aRef)
Gets a validated component.

Specified by:
getComponent in interface IComponentStore

getComponent

public IComponent getComponent(IJobRef aJobRef)
Specified by:
getComponent in interface IInstantiator

addSchemaDataAddition

public void addSchemaDataAddition(IComponent aComponent,
                                  ISchemaDataAdder anAdder)
Description copied from interface: IInstantiator
Registers that some schema data has to be added to a component.

Schema data contains information that must be already converted into corresponding data objects. This conversion can not be done before the components received their bindings and their data creation capability. The instantiator adds the schema data after these steps are done.

Specified by:
addSchemaDataAddition in interface IInstantiator
Parameters:
aComponent - (required). The component that receives data from the schema.
anAdder - (required). The source of the schema data.