Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Development/2.1/DynamicMOXy/296967/BootstrapFromOXM/ObjectFactory"

(Background)
(Background)
Line 31: Line 31:
  
 
</div>
 
</div>
 +
 +
The ObjectFactory is home to the <tt>XmlRegistry</tt> and <tt>XmlElementDecl</tt> annotations

Revision as of 14:48, 2 September 2010

Supporting ObjectFactory in Dynamic JAXB

Background

In standard JAXB, when classes are generated from a schema, an ObjectFactory class is also created, with methods to create new instances of all types in the schema, etc. From the JAXB 2.2 spec:


Idea.png
A public class ObjectFactory contains:

An instance factory method signature for each Java content within the package:

public Foo createFoo();

An element instance factory method signature for each bound element declaration:

public JAXBElement<T> createFoo(T elementValue);

Dynamic instance factory allocator method signature:

public Object newInstance(Class javaContentInterface);

Property setter/getter:

public Object getProperty(String name);

public void setProperty(String name, Object value);


The ObjectFactory is home to the XmlRegistry and XmlElementDecl annotations

Back to the top