Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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/Release/2.4.0/JAXB RI Extensions"

Line 4: Line 4:
  
 
==Cycle Recoverable==
 
==Cycle Recoverable==
Usage: <code>Implement the com.sun.xml.bind.CycleRecoverable interface</code>
 
 
 
Allows the user to write their own logic to be used when object cycles are detected during marshal operations.
 
Allows the user to write their own logic to be used when object cycles are detected during marshal operations.
 +
 +
Usage: <code>Implement the com.sun.xml.bind.CycleRecoverable interface</code>
  
 
See: http://wiki.eclipse.org/EclipseLink/Development/372404
 
See: http://wiki.eclipse.org/EclipseLink/Development/372404
Line 12: Line 12:
  
 
==Object Identitity Cycle Detection==
 
==Object Identitity Cycle Detection==
 +
Used to configure the strategy EclipseLink will use to detect an Object cycle. By default, EclipseLink will use Object identity to determine if a cycle exists; setting this property to false will tell EclipseLink to use the equals() method instead.
  
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.objectIdentitityCycleDetection", false);</code>
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.objectIdentitityCycleDetection", false);</code>
 
Used to configure the strategy EclipseLink will use to detect an Object cycle. By default, EclipseLink will use Object identity to determine if a cycle exists; setting this property to false will tell EclipseLink to use the equals() method instead.
 
  
  
 
==XML Declaration==
 
==XML Declaration==
 +
Allows the user to omit the XML processing instruction from marshalled documens.  This property is the opposite of Marshaller.JAXB_FRAGMENT, and is included for backwards compatibility only.
  
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.xmlDeclaration", true);</code>
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.xmlDeclaration", true);</code>
 
Allows the user to omit the XML processing instruction from marshalled documens.  This property is the opposite of Marshaller.JAXB_FRAGMENT, and is included for backwards compatibility only.
 
  
  
 
==XML Headers==
 
==XML Headers==
 +
Allows the user to supply a header string, which  will appear after the XML processing instruction (&lt;?xml ...&gt;), but before the start of the document's data.
  
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.xmlHeaders", headerString);</code>
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.xmlHeaders", headerString);</code>
 
Allows the user to supply a header string, which  will appear after the XML processing instruction (&lt;?xml ...&gt;), but before the start of the document's data.
 
  
  
 
==Indent String==
 
==Indent String==
 +
Allows the user to override the indent string that is used when marshalling objects.
  
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.indentString", indentString);</code>
 
Usage: <code>marshaller.setProperty("com.sun.xml.bind.indentString", indentString);</code>
 
       <code>marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.INDENT_STRING, indentString);</code>
 
       <code>marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.INDENT_STRING, indentString);</code>
  
Allows the user to override the indent string that is used when marshalling objects.
 
  
 
==Character Escape Handler==
 
==Character Escape Handler==
 +
Allows the user to provide their own character-escaping logic by supplying their own implementation of the CharacterEscapeHandler interface.
  
 
Usage:
 
Usage:
Line 45: Line 43:
 
<code>marshaller.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", new MyCharacterEscapeHandler());</code>
 
<code>marshaller.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", new MyCharacterEscapeHandler());</code>
 
<code>marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.CHARACTER_ESCAPE_HANDLER, new MyCharacterEscapeHandler());</code>
 
<code>marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.CHARACTER_ESCAPE_HANDLER, new MyCharacterEscapeHandler());</code>
 
Allows the user to provide their own character-escaping logic by supplying their own implementation of the CharacterEscapeHandler interface.
 
  
 
See: http://wiki.eclipse.org/EclipseLink/Development/370589
 
See: http://wiki.eclipse.org/EclipseLink/Development/370589
Line 55: Line 51:
  
 
==ID Resolver==
 
==ID Resolver==
 +
Allows the user to provide their own logic for resolving XML IDs/IDREFs.
  
 
Usage: <code>unmarshaller.setProperty("com.sun.xml.bind.IDResolver", new MyIdResolver());</code>
 
Usage: <code>unmarshaller.setProperty("com.sun.xml.bind.IDResolver", new MyIdResolver());</code>
 
       <code>unmarshaller.setProperty(org.eclipse.persistence.jaxb.UnmarshallerProperties.ID_RESOLVER, new MyIdResolver());</code>
 
       <code>unmarshaller.setProperty(org.eclipse.persistence.jaxb.UnmarshallerProperties.ID_RESOLVER, new MyIdResolver());</code>
 
Allows the user to provide their own logic for resolving XML IDs/IDREFs.
 
  
 
See: http://wiki.eclipse.org/EclipseLink/Development/360249
 
See: http://wiki.eclipse.org/EclipseLink/Development/360249
Line 65: Line 60:
  
 
==XML Location==
 
==XML Location==
 +
Allows the user to specify a property on the JAXB object that will be updated (upon unmarshalling) with that object's XML location information (i.e. the line number, column number, and system ID that points to this object's location in the XML input).
  
 
Usage: <code>Annotate a property with @XmlLocation</code>
 
Usage: <code>Annotate a property with @XmlLocation</code>
 
Allows the user to specify a property on the JAXB object that will be updated (upon unmarshalling) with that object's XML location information (i.e. the line number, column number, and system ID that points to this object's location in the XML input).
 
  
 
See: http://wiki.eclipse.org/EclipseLink/Development/355766
 
See: http://wiki.eclipse.org/EclipseLink/Development/355766

Revision as of 11:16, 4 June 2012

Marshaller Features

Cycle Recoverable

Allows the user to write their own logic to be used when object cycles are detected during marshal operations.

Usage: Implement the com.sun.xml.bind.CycleRecoverable interface

See: http://wiki.eclipse.org/EclipseLink/Development/372404


Object Identitity Cycle Detection

Used to configure the strategy EclipseLink will use to detect an Object cycle. By default, EclipseLink will use Object identity to determine if a cycle exists; setting this property to false will tell EclipseLink to use the equals() method instead.

Usage: marshaller.setProperty("com.sun.xml.bind.objectIdentitityCycleDetection", false);


XML Declaration

Allows the user to omit the XML processing instruction from marshalled documens. This property is the opposite of Marshaller.JAXB_FRAGMENT, and is included for backwards compatibility only.

Usage: marshaller.setProperty("com.sun.xml.bind.xmlDeclaration", true);


XML Headers

Allows the user to supply a header string, which will appear after the XML processing instruction (<?xml ...>), but before the start of the document's data.

Usage: marshaller.setProperty("com.sun.xml.bind.xmlHeaders", headerString);


Indent String

Allows the user to override the indent string that is used when marshalling objects.

Usage: marshaller.setProperty("com.sun.xml.bind.indentString", indentString);

      marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.INDENT_STRING, indentString);


Character Escape Handler

Allows the user to provide their own character-escaping logic by supplying their own implementation of the CharacterEscapeHandler interface.

Usage:

marshaller.setProperty("com.sun.xml.bind.marshaller.CharacterEscapeHandler", new MyCharacterEscapeHandler()); marshaller.setProperty(org.eclipse.persistence.jaxb.MarshallerProperties.CHARACTER_ESCAPE_HANDLER, new MyCharacterEscapeHandler());

See: http://wiki.eclipse.org/EclipseLink/Development/370589


Unmarshaller Features

ID Resolver

Allows the user to provide their own logic for resolving XML IDs/IDREFs.

Usage: unmarshaller.setProperty("com.sun.xml.bind.IDResolver", new MyIdResolver());

      unmarshaller.setProperty(org.eclipse.persistence.jaxb.UnmarshallerProperties.ID_RESOLVER, new MyIdResolver());

See: http://wiki.eclipse.org/EclipseLink/Development/360249


XML Location

Allows the user to specify a property on the JAXB object that will be updated (upon unmarshalling) with that object's XML location information (i.e. the line number, column number, and system ID that points to this object's location in the XML input).

Usage: Annotate a property with @XmlLocation

See: http://wiki.eclipse.org/EclipseLink/Development/355766

Back to the top