Tuscany Core

org.apache.tuscany.core.loader.impl
Class StAXLoaderRegistryImpl

java.lang.Object
  extended by org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl
All Implemented Interfaces:
StAXLoaderRegistry

public class StAXLoaderRegistryImpl
extends Object
implements StAXLoaderRegistry

Version:
$Rev$ $Date$

Nested Class Summary
static interface StAXLoaderRegistryImpl.Monitor
           
 
Constructor Summary
StAXLoaderRegistryImpl()
           
 
Method Summary
 AssemblyContext getContext()
          Deprecated. 
 AssemblyObject load(javax.xml.stream.XMLStreamReader reader, LoaderContext loaderContext)
          Parse the supplied XML stream dispatching to the appropriate registered loader for each element encountered in the stream.
<T extends AssemblyObject>
void
registerLoader(QName element, StAXElementLoader<T> loader)
          Register a loader.
 void setContext(AssemblyContext context)
          Deprecated. 
 void setMonitor(StAXLoaderRegistryImpl.Monitor monitor)
           
<T extends AssemblyObject>
void
unregisterLoader(QName element, StAXElementLoader<T> loader)
          Unregister a loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StAXLoaderRegistryImpl

public StAXLoaderRegistryImpl()
Method Detail

setMonitor

public void setMonitor(StAXLoaderRegistryImpl.Monitor monitor)

registerLoader

public <T extends AssemblyObject> void registerLoader(QName element,
                                                      StAXElementLoader<T> loader)
Description copied from interface: StAXLoaderRegistry
Register a loader. This operation will typically be called by a loader during its initialization.

Specified by:
registerLoader in interface StAXLoaderRegistry
Parameters:
element - the element that should be delegated to the contibuted loader
loader - a loader that is being contributed to the system

unregisterLoader

public <T extends AssemblyObject> void unregisterLoader(QName element,
                                                        StAXElementLoader<T> loader)
Description copied from interface: StAXLoaderRegistry
Unregister a loader. This will typically be called by a loader as it is being destroyed.

Specified by:
unregisterLoader in interface StAXLoaderRegistry
Parameters:
element - the element that was being delegated to the contibuted loader
loader - a loader that should no longer be used

load

public AssemblyObject load(javax.xml.stream.XMLStreamReader reader,
                           LoaderContext loaderContext)
                    throws javax.xml.stream.XMLStreamException,
                           ConfigurationLoadException
Description copied from interface: StAXLoaderRegistry
Parse the supplied XML stream dispatching to the appropriate registered loader for each element encountered in the stream.

This method must be called with the XML cursor positioned on a START_ELEMENT event. When this method returns, the stream will be positioned on the corresponding END_ELEMENT event.

Specified by:
load in interface StAXLoaderRegistry
Parameters:
reader - the XML stream to parse
Returns:
the model object obtained by parsing the current element on the stream
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream
ConfigurationLoadException

getContext

@Deprecated
public AssemblyContext getContext()
Deprecated. 

Description copied from interface: StAXLoaderRegistry
Hack to allow loaders to initialize model objects on the fly. Remove when initialization has been moved from the model implementation to the loader.

Specified by:
getContext in interface StAXLoaderRegistry
Returns:
the model context for this load operation

setContext

@Deprecated
public void setContext(AssemblyContext context)
Deprecated. 

Description copied from interface: StAXLoaderRegistry
Hack to allow loaders to initialize model objects on the fly. Remove when initialization has been moved from the model implementation to the loader.

Specified by:
setContext in interface StAXLoaderRegistry
Parameters:
context - the model context for this load operation

Tuscany Core

-