org.apache.tuscany.sca.contribution.processor.xml
Class AnyElementProcessor

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.processor.xml.AnyElementProcessor
All Implemented Interfaces:
ArtifactProcessor<java.lang.Object>, StAXArtifactProcessor<java.lang.Object>

public class AnyElementProcessor
extends java.lang.Object
implements StAXArtifactProcessor<java.lang.Object>


Constructor Summary
AnyElementProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor)
           
 
Method Summary
 javax.xml.namespace.QName getArtifactType()
          Returns the type of artifact handled by this artifact processor.
 java.lang.Class<java.lang.Object> getModelType()
          Returns the type of model handled by this artifact processor.
 java.lang.Object read(javax.xml.stream.XMLStreamReader reader)
          Reads the contetns of the unknown elements and generates a custom implementation of XMLStreamReader i.e.
 void resolve(java.lang.Object model, ModelResolver resolver)
          Resolve references from this model to other models.
 void write(java.lang.Object model, javax.xml.stream.XMLStreamWriter writer)
          Writes unknown portions back to the writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnyElementProcessor

public AnyElementProcessor(ModelFactoryExtensionPoint modelFactories,
                           Monitor monitor)
Method Detail

getArtifactType

public javax.xml.namespace.QName getArtifactType()
Description copied from interface: StAXArtifactProcessor
Returns the type of artifact handled by this artifact processor.

Specified by:
getArtifactType in interface StAXArtifactProcessor<java.lang.Object>
Returns:
The type of artifact handled by this artifact processor

getModelType

public java.lang.Class<java.lang.Object> getModelType()
Description copied from interface: ArtifactProcessor
Returns the type of model handled by this artifact processor.

Specified by:
getModelType in interface ArtifactProcessor<java.lang.Object>
Returns:
The type of model handled by this artifact processor

read

public java.lang.Object read(javax.xml.stream.XMLStreamReader reader)
                      throws ContributionReadException,
                             javax.xml.stream.XMLStreamException
Reads the contetns of the unknown elements and generates a custom implementation of XMLStreamReader i.e. XMLEventsStreamReader

Specified by:
read in interface StAXArtifactProcessor<java.lang.Object>
Parameters:
reader -
Returns:
Throws:
javax.xml.stream.XMLStreamException
ContributionReadException

write

public void write(java.lang.Object model,
                  javax.xml.stream.XMLStreamWriter writer)
           throws javax.xml.stream.XMLStreamException
Writes unknown portions back to the writer

Specified by:
write in interface StAXArtifactProcessor<java.lang.Object>
Parameters:
model -
writer -
Throws:
javax.xml.stream.XMLStreamException

resolve

public void resolve(java.lang.Object model,
                    ModelResolver resolver)
             throws ContributionResolveException
Description copied from interface: ArtifactProcessor
Resolve references from this model to other models. For example references from a composite to another one, or references from a composite to a WSDL model.

Specified by:
resolve in interface ArtifactProcessor<java.lang.Object>
Parameters:
model - The model to resolve
resolver - The resolver to use to resolve referenced models
Throws:
ContributionResolveException