org.jboss.deployers.vfs.spi.deployer
Class JAXPDeployer<T>

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
      extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployer
          extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput<T>
              extended by org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer<T>
                  extended by org.jboss.deployers.vfs.spi.deployer.UnmarshallerFactoryDeployer<T,Boolean>
                      extended by org.jboss.deployers.vfs.spi.deployer.JAXPDeployer<T>
Type Parameters:
T - the expected type
All Implemented Interfaces:
Deployer, JarExtensionProvider, Ordered, FileMatcher
Direct Known Subclasses:
XSLDeployer

public abstract class JAXPDeployer<T>
extends UnmarshallerFactoryDeployer<T,Boolean>

JAXPDeployer is an abstract deployer that overrides parse to run a jaxp parse of the VirtualFile passed to parse.

Version:
$Revision: 60707 $
Author:
Adrian Brock, Scott.Stark@jboss.org, Ales Justin
See Also:
parse(VFSDeploymentUnit, VirtualFile, Object), doParse(VFSDeploymentUnit, VirtualFile)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.deployers.spi.Ordered
Ordered.OrderedComparator
 
Field Summary
 
Fields inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
log
 
Fields inherited from interface org.jboss.deployers.spi.Ordered
COMPARATOR
 
Constructor Summary
JAXPDeployer(Class<T> output)
          Create a new JAXPDeployer.
 
Method Summary
 void create()
          Create lifecycle
protected  org.jboss.deployers.vfs.spi.deployer.UnmarshallerFactory<Boolean> createUnmarshallerFactory()
          Create unmarshaller factory wrapper.
 void destroy()
          Destroy lifecycle
protected  Document doParse(VFSDeploymentUnit unit, org.jboss.virtual.VirtualFile file)
          Do the parsing
protected  Boolean fromString(String value)
          Transform string to flag value.
protected  DocumentBuilderFactory getDocumentBuilderFactory()
          Get the documentBuilderFactory.
 boolean isUseNamespaceAwareParser()
          Get the useNamespaceAwareParser.
 boolean isValidateDTDs()
          Get the validateDTDs.
protected abstract  T parse(VFSDeploymentUnit unit, org.jboss.virtual.VirtualFile file, Document document)
          Parse a deployment
protected  T parse(VFSDeploymentUnit unit, org.jboss.virtual.VirtualFile file, T root)
          Parse a deployment
 void setSchemaLocation(String schemaLocation)
          Set schema location.
 void setUseNamespaceAwareParser(boolean useNamespaceAwareParser)
          Set the useNamespaceAwareParser.
 void setValidateDTDs(boolean validateDTDs)
          Set the validateDTDs.
 
Methods inherited from class org.jboss.deployers.vfs.spi.deployer.UnmarshallerFactoryDeployer
getFeatures, isUseDefaultFeatures, setFeatures, setUseDefaultFeatures, start
 
Methods inherited from class org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer
accepts, accepts, allowsMultipleFiles, getAltMappings, getMetadataFile, handleMultipleFiles, init, isDeployable, matchFileToClass, mergeFiles, openStreamAndValidate, parse, parse, parse, parse, parseAndInit, setAllowMultipleFiles
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput
allowsReparse, createMetaData, createMetaData, createMetaData, createMetaData, deploy, getAttachmentKey, getJarExtension, getMetaData, getName, getNames, getOutput, getSuffix, isBuildManagedObject, isIncludeDeploymentFile, setAttachmentKey, setBuildManagedObject, setIncludeDeploymentFile, setJarExtension, setName, setNames, setSuffix
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
addInput, addInput, addOutput, addOutput, getInput, getInputs, getOutputs, getRelativeOrder, getStage, isAllInputs, isComponentsOnly, isParentFirst, isTopLevelOnly, isWantComponents, setAllInputs, setComponentsOnly, setInput, setInputs, setInputs, setInputs, setOutput, setOutputs, setOutputs, setOutputs, setParentFirst, setRelativeOrder, setStage, setTopLevelOnly, setWantComponents, undeploy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXPDeployer

public JAXPDeployer(Class<T> output)
Create a new JAXPDeployer.

Parameters:
output - the output
Throws:
IllegalArgumentException - for a null output
Method Detail

isUseNamespaceAwareParser

public boolean isUseNamespaceAwareParser()
Get the useNamespaceAwareParser.

Returns:
the useNamespaceAwareParser.

setUseNamespaceAwareParser

public void setUseNamespaceAwareParser(boolean useNamespaceAwareParser)
Set the useNamespaceAwareParser.

Parameters:
useNamespaceAwareParser - the useNamespaceAwareParser.

isValidateDTDs

public boolean isValidateDTDs()
Get the validateDTDs.

Returns:
the validateDTDs.

setValidateDTDs

public void setValidateDTDs(boolean validateDTDs)
Set the validateDTDs.

Parameters:
validateDTDs - the validateDTDs.

setSchemaLocation

public void setSchemaLocation(String schemaLocation)
Set schema location.

Parameters:
schemaLocation - the schema location

getDocumentBuilderFactory

protected DocumentBuilderFactory getDocumentBuilderFactory()
Get the documentBuilderFactory.

Returns:
the documentBuilderFactory.
Throws:
IllegalStateException - if the create method has not been invoked

create

public void create()
            throws Exception
Create lifecycle

Throws:
Exception - for any problem

destroy

public void destroy()
Destroy lifecycle


createUnmarshallerFactory

protected org.jboss.deployers.vfs.spi.deployer.UnmarshallerFactory<Boolean> createUnmarshallerFactory()
Description copied from class: UnmarshallerFactoryDeployer
Create unmarshaller factory wrapper.

Specified by:
createUnmarshallerFactory in class UnmarshallerFactoryDeployer<T,Boolean>
Returns:
the unmarshaller factory

fromString

protected Boolean fromString(String value)
Description copied from class: UnmarshallerFactoryDeployer
Transform string to flag value.

Specified by:
fromString in class UnmarshallerFactoryDeployer<T,Boolean>
Parameters:
value - the value
Returns:
value as T type

parse

protected T parse(VFSDeploymentUnit unit,
                  org.jboss.virtual.VirtualFile file,
                  T root)
           throws Exception
Description copied from class: AbstractVFSParsingDeployer
Parse a deployment

Specified by:
parse in class AbstractVFSParsingDeployer<T>
Parameters:
unit - the deployment unit
file - the metadata file
root - - possibly null pre-existing root
Returns:
the metadata
Throws:
Exception - for any error

doParse

protected Document doParse(VFSDeploymentUnit unit,
                           org.jboss.virtual.VirtualFile file)
                    throws Exception
Do the parsing

Parameters:
unit - the deployment unit
file - the metadata file
Returns:
the document
Throws:
Exception - for any error

parse

protected abstract T parse(VFSDeploymentUnit unit,
                           org.jboss.virtual.VirtualFile file,
                           Document document)
                    throws Exception
Parse a deployment

Parameters:
unit - the deployment unit
file - the metadata file
document - the document
Returns:
the metadata
Throws:
Exception - for any error


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.