org.jboss.deployers.vfs.spi.deployer
Class JAXBDeployer<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.JAXBDeployer<T>
Type Parameters:
T - the expected type
All Implemented Interfaces:
Deployer, JarExtensionProvider, Ordered, FileMatcher

public abstract class JAXBDeployer<T>
extends AbstractVFSParsingDeployer<T>

JAXBDeployer.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin

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
JAXBDeployer(Class<T> output)
          Create a new JAXBDeployer.
 
Method Summary
protected  Class<?>[] classesToBeBound()
          Get classes to be bound.
 void create()
          Create lifecycle
protected  javax.xml.bind.JAXBContext createContext()
          Create context.
 void destroy()
          Destroy lifecycle
 Map<String,Object> getProperties()
          Get the properties.
protected  T parse(VFSDeploymentUnit unit, org.jboss.virtual.VirtualFile file, T root)
          Parse a deployment
 void setClassesToBeBound(Class<?>... classesToBeBound)
          Set the classes to be bound.
 void setProperties(Map<String,Object> properties)
          Set the properties.
 void setSchemaLocation(String schemaLocation)
          Set schema location.
 void setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
          Set the validation event handler.
 
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

JAXBDeployer

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

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

getProperties

public Map<String,Object> getProperties()
Get the properties.

Returns:
the properties.

setProperties

public void setProperties(Map<String,Object> properties)
Set the properties.

Parameters:
properties - the properties.

setClassesToBeBound

public void setClassesToBeBound(Class<?>... classesToBeBound)
Set the classes to be bound.

Parameters:
classesToBeBound - the classes to be bouond

setSchemaLocation

public void setSchemaLocation(String schemaLocation)
Set schema location.

Parameters:
schemaLocation - the schema location

setValidationEventHandler

public void setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
Set the validation event handler.

Parameters:
validationEventHandler - the validation event handler

create

public void create()
            throws Exception
Create lifecycle

Throws:
Exception - for any problem

createContext

protected javax.xml.bind.JAXBContext createContext()
                                            throws Exception
Create context.

Returns:
new context instance
Throws:
Exception - for any error

classesToBeBound

protected Class<?>[] classesToBeBound()
Get classes to be bound.

Returns:
the classes to be bound

destroy

public void destroy()
Destroy lifecycle


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


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