Class DynamicJAXBContext
- java.lang.Object
-
- jakarta.xml.bind.JAXBContext
-
- org.eclipse.persistence.jaxb.JAXBContext
-
- org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext
-
public class DynamicJAXBContext extends JAXBContext
A specialized
JAXBContext
for marshalling and unmarshallingDynamicEntities
.DynamicJAXBContext
also provides methods to:- get the
DynamicType
associated with a given Java name - get the
DynamicType
associated with a given XML name - create a new
DynamicEntity
given the Java name of itsDynamicType
- create a new
DynamicEntity
given the XML name of itsDynamicType
New instances of
DynamicJAXBContext
must be created withDynamicJAXBContextFactory
.- Since:
- EclipseLink 2.1
- Author:
- rbarkhouse
- See Also:
JAXBContext
,DynamicJAXBContextFactory
,DynamicEntity
,DynamicType
- get the
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.jaxb.JAXBContext
JAXBContext.JAXBContextInput, JAXBContext.JAXBContextState
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jaxb.JAXBContext
contextInput, contextState, DEFAULT_VALIDATION_EVENT_HANDLER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicClassLoader
getDynamicClassLoader()
DynamicType
getDynamicType(String javaName)
Obtain a reference to theDynamicType
object for a given Java name.Object
getEnumConstant(String enumName, String constantName)
Returns the constant namedconstantName
from the enum class specified byenumName
.DynamicEntity
newDynamicEntity(String javaName)
Create a new instance ofDynamicEntity
for a given Java name.DynamicEntity
newDynamicEntity(DynamicType dynamicType)
Create a new instance ofDynamicEntity
for a givenDynamicType
.-
Methods inherited from class org.eclipse.persistence.jaxb.JAXBContext
applyORMMetadata, createBinder, createBinder, createByQualifiedName, createByXPath, createJAXBElement, createJAXBElementFromXMLRoot, createJAXBIntrospector, createMarshaller, createObjectGraph, createObjectGraph, createUnmarshaller, createValidator, generateJsonSchema, generateSchema, generateSchema, getArrayClassesToGeneratedClasses, getBeanValidationHelper, getClassToGeneratedClasses, getCollectionClassesToGeneratedClasses, getQNamesToDeclaredClasses, getTypeMappingInfoToSchemaType, getTypeToSchemaType, getValueByXPath, getXMLContext, getXMLInputFactory, hasSwaRef, initTypeToSchemaType, refreshMetadata, setClassToGeneratedClasses, setQNamesToDeclaredClasses, setQNameToGeneratedClasses, setValueByXPath, setXMLContext
-
-
-
-
Method Detail
-
getDynamicClassLoader
public DynamicClassLoader getDynamicClassLoader()
-
getDynamicType
public DynamicType getDynamicType(String javaName)
Obtain a reference to theDynamicType
object for a given Java name. If one has not been generated, this method will returnnull
.- Parameters:
javaName
- A Java class name, used to look up itsDynamicType
.- Returns:
- The
DynamicType
for this Java class name.
-
newDynamicEntity
public DynamicEntity newDynamicEntity(String javaName) throws IllegalArgumentException
Create a new instance ofDynamicEntity
for a given Java name. If aDynamicType
for this Java class name has not been generated, this method will returnnull
.- Parameters:
javaName
- The Java class name to create a newDynamicEntity
for.- Returns:
- A new
DynamicEntity
for this Java class name. - Throws:
IllegalArgumentException
-
newDynamicEntity
public DynamicEntity newDynamicEntity(DynamicType dynamicType)
Create a new instance ofDynamicEntity
for a givenDynamicType
.- Parameters:
dynamicType
- TheDynamicType
to create a newDynamicEntity
for.- Returns:
- A new
DynamicEntity
for thisDynamicType
.
-
getEnumConstant
public Object getEnumConstant(String enumName, String constantName) throws ClassNotFoundException, jakarta.xml.bind.JAXBException
Returns the constant namedconstantName
from the enum class specified byenumName
.- Parameters:
enumName
- Java class name of an enum.constantName
- Name of the constant to get from the specified enum.- Returns:
- An
Object
, the constant from the specified enum. - Throws:
ClassNotFoundException
jakarta.xml.bind.JAXBException
-
-