EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.oxm
Class NamespacePrefixMapper

java.lang.Object
  extended by org.eclipse.persistence.oxm.NamespacePrefixMapper

public abstract class NamespacePrefixMapper
extends java.lang.Object

Purpose:Provides a means to customise the namespace prefixes used while marshalling An implementation of this class can be set on an instance of XMLMarshaller to allow for each instance of XMLMarshaller to use different namespace prefixes.


Constructor Summary
NamespacePrefixMapper()
           
 
Method Summary
 java.lang.String[] getContextualNamespaceDecls()
          Returns a string array of prefixes and namespace uris that are already available in this context.
 java.lang.String[] getPreDeclaredNamespaceUris()
          Returns a list of namespace uris that should be declared at the root of the xml document being marshalled.
 java.lang.String[] getPreDeclaredNamespaceUris2()
          Returns a string array of prefixes and namespace uris to be declared at the root of the document.
abstract  java.lang.String getPreferredPrefix(java.lang.String namespaceUri, java.lang.String suggestion, boolean requirePrefix)
           
 boolean supportsMediaType(MediaType mediaType)
          Return true if this prefix mapper applies to the media type provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespacePrefixMapper

public NamespacePrefixMapper()
Method Detail

getPreferredPrefix

public abstract java.lang.String getPreferredPrefix(java.lang.String namespaceUri,
                                                    java.lang.String suggestion,
                                                    boolean requirePrefix)

getPreDeclaredNamespaceUris

public java.lang.String[] getPreDeclaredNamespaceUris()
Returns a list of namespace uris that should be declared at the root of the xml document being marshalled.


getPreDeclaredNamespaceUris2

public java.lang.String[] getPreDeclaredNamespaceUris2()
Returns a string array of prefixes and namespace uris to be declared at the root of the document. This eliminates the need of implementing both getPredeclaredNamespaceUris and getPreferredPrefix since the prefix and uri can be associated here.

Returns:

getContextualNamespaceDecls

public java.lang.String[] getContextualNamespaceDecls()
Returns a string array of prefixes and namespace uris that are already available in this context. Only required when marshalling to an output stream or a writer, since it's not possible to determine which namespaces are already in scope.

Returns:

supportsMediaType

public boolean supportsMediaType(MediaType mediaType)
Return true if this prefix mapper applies to the media type provided.


EclipseLink 2.4.2, build 'v20130514-5956486' API Reference