|
EclipseLink 2.1.0, build 'v20100311-r6779' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.jaxb.DynamicJAXBContextFactory
public class DynamicJAXBContextFactory
DynamicJAXBContextFactory allows the user to create a DynamicJAXBContext without having realized Java classes available on the classpath. During context creation, the user's metadata will be analyzed, and in-memory classes will be generated.
Objects that are returned by EclipseLink unmarshal methods will be subclasses of DynamicEntity. DynamicEntities offer a simple get(propertyName) / set(propertyName, propertyValue) API to manipulate their data.
Example:
String sessionName = "mynamespace.Employee";
ClassLoader loader = Thread.currentThread().getContextClassLoader();
DynamicJAXBContext dContext = DynamicJAXBContextFactory.createContext(sessionName, null);
DynamicEntity employee = dContext.newDynamicEntity("mynamespace.Employee");
employee.set("firstName", "Bob");
employee.set("lastName", "Barker");
dContext.createMarshaller().(employee, System.out);
JAXBContext
,
DynamicJAXBContext
,
DynamicEntity
,
DynamicType
Constructor Summary | |
---|---|
DynamicJAXBContextFactory()
|
Method Summary | |
---|---|
static DynamicJAXBContext |
createContext(java.lang.Class[] classes,
java.util.Map props)
Unsupported Operation. |
static DynamicJAXBContext |
createContext(java.lang.String sessionNames,
java.lang.ClassLoader classLoader,
java.util.Map<java.lang.String,?> props)
Create a DynamicJAXBContext, using an EclipseLink sessions.xml as the metadata source. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DynamicJAXBContextFactory()
Method Detail |
---|
public static DynamicJAXBContext createContext(java.lang.String sessionNames, java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,?> props) throws JAXBException
sessionNames
- A colon-delimited String specifying the session names from the sessions.xml file.classLoader
- The application's current class loader, which will be used to first lookup
classes to see if they exist before new DynamicTypes are generated. Can be
null, in which case Thread.currentThread().getContextClassLoader() will be used.
JAXBException
- if an error was encountered while creating the DynamicJAXBContext.public static DynamicJAXBContext createContext(java.lang.Class[] classes, java.util.Map props) throws JAXBException
JAXBException
JAXBContext
|
EclipseLink 2.1.0, build 'v20100311-r6779' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |