org.apache.camel.converter.jaxb.mapper
Class SunJaxb21NamespacePrefixMapper

java.lang.Object
  extended by com.sun.xml.bind.marshaller.NamespacePrefixMapper
      extended by org.apache.camel.converter.jaxb.mapper.SunJaxb21NamespacePrefixMapper
All Implemented Interfaces:
JaxbNamespacePrefixMapper

public class SunJaxb21NamespacePrefixMapper
extends com.sun.xml.bind.marshaller.NamespacePrefixMapper
implements JaxbNamespacePrefixMapper

A namespace prefix mapper which uses JAXB-RI 2.1 or better from SUN.


Constructor Summary
SunJaxb21NamespacePrefixMapper()
           
 
Method Summary
 String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix)
          Used by JAXB to obtain the preferred prefix.
 String getRegistrationKey()
          JAXB requires the mapper to be registered as a property on the JAXBContext.
 void setNamespaces(Map<String,String> namespaces)
          Sets the namespace prefix mapping.
 
Methods inherited from class com.sun.xml.bind.marshaller.NamespacePrefixMapper
getContextualNamespaceDecls, getPreDeclaredNamespaceUris, getPreDeclaredNamespaceUris2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunJaxb21NamespacePrefixMapper

public SunJaxb21NamespacePrefixMapper()
Method Detail

setNamespaces

public void setNamespaces(Map<String,String> namespaces)
Description copied from interface: JaxbNamespacePrefixMapper
Sets the namespace prefix mapping.

The key is the namespace, the value is the prefix to use.

Specified by:
setNamespaces in interface JaxbNamespacePrefixMapper
Parameters:
namespaces - namespace mappings

getRegistrationKey

public String getRegistrationKey()
Description copied from interface: JaxbNamespacePrefixMapper
JAXB requires the mapper to be registered as a property on the JAXBContext.

Specified by:
getRegistrationKey in interface JaxbNamespacePrefixMapper

getPreferredPrefix

public String getPreferredPrefix(String namespaceUri,
                                 String suggestion,
                                 boolean requirePrefix)
Description copied from interface: JaxbNamespacePrefixMapper
Used by JAXB to obtain the preferred prefix.

Specified by:
getPreferredPrefix in interface JaxbNamespacePrefixMapper
Specified by:
getPreferredPrefix in class com.sun.xml.bind.marshaller.NamespacePrefixMapper


Apache Camel