org.jboss.shrinkwrap.descriptor.impl.persistence20
Class PersistenceUnitImpl<T>

java.lang.Object
  extended by org.jboss.shrinkwrap.descriptor.impl.persistence20.PersistenceUnitImpl<T>
All Implemented Interfaces:
org.jboss.shrinkwrap.descriptor.api.Child<T>, PersistenceUnit<T>

public class PersistenceUnitImpl<T>
extends java.lang.Object
implements org.jboss.shrinkwrap.descriptor.api.Child<T>, PersistenceUnit<T>

This class implements the persistence-unit xsd type

Since:
Generation date :2011-07-19T22:55:02.759+02:00
Author:
Ralf Battenfeld

Constructor Summary
PersistenceUnitImpl(T t, java.lang.String nodeName, org.jboss.shrinkwrap.descriptor.spi.Node node)
           
PersistenceUnitImpl(T t, java.lang.String nodeName, org.jboss.shrinkwrap.descriptor.spi.Node node, org.jboss.shrinkwrap.descriptor.spi.Node childNode)
           
 
Method Summary
 java.util.List<java.lang.String> getClazzList()
          Returns all class elements
 java.lang.String getDescription()
          Returns the description element
 java.util.List<java.lang.String> getJarFileList()
          Returns all jar-file elements
 java.lang.String getJtaDataSource()
          Returns the jta-data-source element
 java.util.List<java.lang.String> getMappingFileList()
          Returns all mapping-file elements
 java.lang.String getName()
          Returns the name element
 java.lang.String getNonJtaDataSource()
          Returns the non-jta-data-source element
 java.lang.String getProvider()
          Returns the provider element
 PersistenceUnitCachingType getSharedCacheMode()
          Returns the shared-cache-mode element
 java.lang.String getSharedCacheModeAsString()
          Returns the shared-cache-mode element
 PersistenceUnitTransactionType getTransactionType()
          Returns the transaction-type element
 java.lang.String getTransactionTypeAsString()
          Returns the transaction-type element
 PersistenceUnitValidationModeType getValidationMode()
          Returns the validation-mode element
 java.lang.String getValidationModeAsString()
          Returns the validation-mode element
 java.lang.Boolean isExcludeUnlistedClasses()
          Returns the exclude-unlisted-classes element
 Properties<PersistenceUnit<T>> properties()
          If not already created, a new properties element will be created and returned.
 PersistenceUnit<T> removeAllClazz()
          Removes the class element
 PersistenceUnit<T> removeAllJarFile()
          Removes the jar-file element
 PersistenceUnit<T> removeAllMappingFile()
          Removes the mapping-file element
 PersistenceUnit<T> removeDescription()
          Removes the description element
 PersistenceUnit<T> removeExcludeUnlistedClasses()
          Removes the exclude-unlisted-classes element
 PersistenceUnit<T> removeJtaDataSource()
          Removes the jta-data-source element
 PersistenceUnit<T> removeName()
          Removes the name attribute
 PersistenceUnit<T> removeNonJtaDataSource()
          Removes the non-jta-data-source element
 PersistenceUnit<T> removeProperties()
          Removes the properties element
 PersistenceUnit<T> removeProvider()
          Removes the provider element
 PersistenceUnit<T> removeTransactionType()
          Removes the transaction-type attribute
 PersistenceUnit<T> setClazz(java.lang.String clazz)
          Creates a new class element
 PersistenceUnit<T> setClazzList(java.lang.String... values)
          Creates for all String objects representing class elements, a new class element
 PersistenceUnit<T> setDescription(java.lang.String description)
          If not already created, a new description element with the given value will be created.
 PersistenceUnit<T> setExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
          If not already created, a new exclude-unlisted-classes element with the given value will be created.
 PersistenceUnit<T> setJarFile(java.lang.String jarFile)
          Creates a new jar-file element
 PersistenceUnit<T> setJarFileList(java.lang.String... values)
          Creates for all String objects representing jar-file elements, a new jar-file element
 PersistenceUnit<T> setJtaDataSource(java.lang.String jtaDataSource)
          If not already created, a new jta-data-source element with the given value will be created.
 PersistenceUnit<T> setMappingFile(java.lang.String mappingFile)
          Creates a new mapping-file element
 PersistenceUnit<T> setMappingFileList(java.lang.String... values)
          Creates for all String objects representing mapping-file elements, a new mapping-file element
 PersistenceUnit<T> setName(java.lang.String name)
          Sets the name attribute
 PersistenceUnit<T> setNonJtaDataSource(java.lang.String nonJtaDataSource)
          If not already created, a new non-jta-data-source element with the given value will be created.
 PersistenceUnit<T> setProvider(java.lang.String provider)
          If not already created, a new provider element with the given value will be created.
 PersistenceUnit<T> setSharedCacheMode(PersistenceUnitCachingType sharedCacheMode)
          If not already created, a new shared-cache-mode element with the given value will be created.
 PersistenceUnit<T> setSharedCacheMode(java.lang.String sharedCacheMode)
          If not already created, a new shared-cache-mode element with the given value will be created.
 PersistenceUnit<T> setTransactionType(PersistenceUnitTransactionType transactionType)
          Sets the transaction-type attribute
 PersistenceUnit<T> setTransactionType(java.lang.String transactionType)
          Sets the transaction-type attribute
 PersistenceUnit<T> setValidationMode(PersistenceUnitValidationModeType validationMode)
          If not already created, a new validation-mode element with the given value will be created.
 PersistenceUnit<T> setValidationMode(java.lang.String validationMode)
          If not already created, a new validation-mode element with the given value will be created.
 T up()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceUnitImpl

public PersistenceUnitImpl(T t,
                           java.lang.String nodeName,
                           org.jboss.shrinkwrap.descriptor.spi.Node node)

PersistenceUnitImpl

public PersistenceUnitImpl(T t,
                           java.lang.String nodeName,
                           org.jboss.shrinkwrap.descriptor.spi.Node node,
                           org.jboss.shrinkwrap.descriptor.spi.Node childNode)
Method Detail

up

public T up()
Specified by:
up in interface org.jboss.shrinkwrap.descriptor.api.Child<T>

setDescription

public PersistenceUnit<T> setDescription(java.lang.String description)
If not already created, a new description element with the given value will be created. Otherwise, the existing description element will be updated with the given value.

Specified by:
setDescription in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

removeDescription

public PersistenceUnit<T> removeDescription()
Removes the description element

Specified by:
removeDescription in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getDescription

public java.lang.String getDescription()
Returns the description element

Specified by:
getDescription in interface PersistenceUnit<T>
Returns:
the node defined for the element description

setProvider

public PersistenceUnit<T> setProvider(java.lang.String provider)
If not already created, a new provider element with the given value will be created. Otherwise, the existing provider element will be updated with the given value.

Specified by:
setProvider in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

removeProvider

public PersistenceUnit<T> removeProvider()
Removes the provider element

Specified by:
removeProvider in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getProvider

public java.lang.String getProvider()
Returns the provider element

Specified by:
getProvider in interface PersistenceUnit<T>
Returns:
the node defined for the element provider

setJtaDataSource

public PersistenceUnit<T> setJtaDataSource(java.lang.String jtaDataSource)
If not already created, a new jta-data-source element with the given value will be created. Otherwise, the existing jta-data-source element will be updated with the given value.

Specified by:
setJtaDataSource in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

removeJtaDataSource

public PersistenceUnit<T> removeJtaDataSource()
Removes the jta-data-source element

Specified by:
removeJtaDataSource in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getJtaDataSource

public java.lang.String getJtaDataSource()
Returns the jta-data-source element

Specified by:
getJtaDataSource in interface PersistenceUnit<T>
Returns:
the node defined for the element jta-data-source

setNonJtaDataSource

public PersistenceUnit<T> setNonJtaDataSource(java.lang.String nonJtaDataSource)
If not already created, a new non-jta-data-source element with the given value will be created. Otherwise, the existing non-jta-data-source element will be updated with the given value.

Specified by:
setNonJtaDataSource in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

removeNonJtaDataSource

public PersistenceUnit<T> removeNonJtaDataSource()
Removes the non-jta-data-source element

Specified by:
removeNonJtaDataSource in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getNonJtaDataSource

public java.lang.String getNonJtaDataSource()
Returns the non-jta-data-source element

Specified by:
getNonJtaDataSource in interface PersistenceUnit<T>
Returns:
the node defined for the element non-jta-data-source

setMappingFile

public PersistenceUnit<T> setMappingFile(java.lang.String mappingFile)
Creates a new mapping-file element

Specified by:
setMappingFile in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

setMappingFileList

public PersistenceUnit<T> setMappingFileList(java.lang.String... values)
Creates for all String objects representing mapping-file elements, a new mapping-file element

Specified by:
setMappingFileList in interface PersistenceUnit<T>
Parameters:
list - of mapping-file objects
Returns:
the current instance of PersistenceUnit

removeAllMappingFile

public PersistenceUnit<T> removeAllMappingFile()
Removes the mapping-file element

Specified by:
removeAllMappingFile in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getMappingFileList

public java.util.List<java.lang.String> getMappingFileList()
Returns all mapping-file elements

Specified by:
getMappingFileList in interface PersistenceUnit<T>
Returns:
list of mapping-file

setJarFile

public PersistenceUnit<T> setJarFile(java.lang.String jarFile)
Creates a new jar-file element

Specified by:
setJarFile in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

setJarFileList

public PersistenceUnit<T> setJarFileList(java.lang.String... values)
Creates for all String objects representing jar-file elements, a new jar-file element

Specified by:
setJarFileList in interface PersistenceUnit<T>
Parameters:
list - of jar-file objects
Returns:
the current instance of PersistenceUnit

removeAllJarFile

public PersistenceUnit<T> removeAllJarFile()
Removes the jar-file element

Specified by:
removeAllJarFile in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getJarFileList

public java.util.List<java.lang.String> getJarFileList()
Returns all jar-file elements

Specified by:
getJarFileList in interface PersistenceUnit<T>
Returns:
list of jar-file

setClazz

public PersistenceUnit<T> setClazz(java.lang.String clazz)
Creates a new class element

Specified by:
setClazz in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

setClazzList

public PersistenceUnit<T> setClazzList(java.lang.String... values)
Creates for all String objects representing class elements, a new class element

Specified by:
setClazzList in interface PersistenceUnit<T>
Parameters:
list - of class objects
Returns:
the current instance of PersistenceUnit

removeAllClazz

public PersistenceUnit<T> removeAllClazz()
Removes the class element

Specified by:
removeAllClazz in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getClazzList

public java.util.List<java.lang.String> getClazzList()
Returns all class elements

Specified by:
getClazzList in interface PersistenceUnit<T>
Returns:
list of class

setExcludeUnlistedClasses

public PersistenceUnit<T> setExcludeUnlistedClasses(java.lang.Boolean excludeUnlistedClasses)
If not already created, a new exclude-unlisted-classes element with the given value will be created. Otherwise, the existing exclude-unlisted-classes element will be updated with the given value.

Specified by:
setExcludeUnlistedClasses in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

removeExcludeUnlistedClasses

public PersistenceUnit<T> removeExcludeUnlistedClasses()
Removes the exclude-unlisted-classes element

Specified by:
removeExcludeUnlistedClasses in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

isExcludeUnlistedClasses

public java.lang.Boolean isExcludeUnlistedClasses()
Returns the exclude-unlisted-classes element

Specified by:
isExcludeUnlistedClasses in interface PersistenceUnit<T>
Returns:
the node defined for the element exclude-unlisted-classes

setSharedCacheMode

public PersistenceUnit<T> setSharedCacheMode(PersistenceUnitCachingType sharedCacheMode)
If not already created, a new shared-cache-mode element with the given value will be created. Otherwise, the existing shared-cache-mode element will be updated with the given value.

Specified by:
setSharedCacheMode in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

setSharedCacheMode

public PersistenceUnit<T> setSharedCacheMode(java.lang.String sharedCacheMode)
If not already created, a new shared-cache-mode element with the given value will be created. Otherwise, the existing shared-cache-mode element will be updated with the given value.

Specified by:
setSharedCacheMode in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getSharedCacheMode

public PersistenceUnitCachingType getSharedCacheMode()
Returns the shared-cache-mode element

Specified by:
getSharedCacheMode in interface PersistenceUnit<T>
Returns:
the node defined for the element shared-cache-mode

getSharedCacheModeAsString

public java.lang.String getSharedCacheModeAsString()
Returns the shared-cache-mode element

Specified by:
getSharedCacheModeAsString in interface PersistenceUnit<T>
Returns:
the node defined for the element shared-cache-mode

setValidationMode

public PersistenceUnit<T> setValidationMode(PersistenceUnitValidationModeType validationMode)
If not already created, a new validation-mode element with the given value will be created. Otherwise, the existing validation-mode element will be updated with the given value.

Specified by:
setValidationMode in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

setValidationMode

public PersistenceUnit<T> setValidationMode(java.lang.String validationMode)
If not already created, a new validation-mode element with the given value will be created. Otherwise, the existing validation-mode element will be updated with the given value.

Specified by:
setValidationMode in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getValidationMode

public PersistenceUnitValidationModeType getValidationMode()
Returns the validation-mode element

Specified by:
getValidationMode in interface PersistenceUnit<T>
Returns:
the node defined for the element validation-mode

getValidationModeAsString

public java.lang.String getValidationModeAsString()
Returns the validation-mode element

Specified by:
getValidationModeAsString in interface PersistenceUnit<T>
Returns:
the node defined for the element validation-mode

removeProperties

public PersistenceUnit<T> removeProperties()
Removes the properties element

Specified by:
removeProperties in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

properties

public Properties<PersistenceUnit<T>> properties()
If not already created, a new properties element will be created and returned. Otherwise, the existing properties element will be returned.

Specified by:
properties in interface PersistenceUnit<T>
Returns:
the node defined for the element properties

setName

public PersistenceUnit<T> setName(java.lang.String name)
Sets the name attribute

Specified by:
setName in interface PersistenceUnit<T>
Parameters:
name - the value for the attribute name
Returns:
the current instance of PersistenceUnit

removeName

public PersistenceUnit<T> removeName()
Removes the name attribute

Specified by:
removeName in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getName

public java.lang.String getName()
Returns the name element

Specified by:
getName in interface PersistenceUnit<T>
Returns:
the node defined for the element name

setTransactionType

public PersistenceUnit<T> setTransactionType(PersistenceUnitTransactionType transactionType)
Sets the transaction-type attribute

Specified by:
setTransactionType in interface PersistenceUnit<T>
Parameters:
transactionType - the value for the attribute transaction-type
Returns:
the current instance of PersistenceUnit

setTransactionType

public PersistenceUnit<T> setTransactionType(java.lang.String transactionType)
Sets the transaction-type attribute

Specified by:
setTransactionType in interface PersistenceUnit<T>
Parameters:
transactionType - the value for the attribute transaction-type
Returns:
the current instance of PersistenceUnit

removeTransactionType

public PersistenceUnit<T> removeTransactionType()
Removes the transaction-type attribute

Specified by:
removeTransactionType in interface PersistenceUnit<T>
Returns:
the current instance of PersistenceUnit

getTransactionType

public PersistenceUnitTransactionType getTransactionType()
Returns the transaction-type element

Specified by:
getTransactionType in interface PersistenceUnit<T>
Returns:
the node defined for the element transaction-type

getTransactionTypeAsString

public java.lang.String getTransactionTypeAsString()
Returns the transaction-type element

Specified by:
getTransactionTypeAsString in interface PersistenceUnit<T>
Returns:
the node defined for the element transaction-type