Class JAXBUtils
java.lang.Object
org.apache.axis2.jaxws.message.databinding.JAXBUtils
JAXB Utilites to pool JAXBContext and related objects.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic jakarta.xml.bind.JAXBContextgetJAXBContext(TreeSet<String> contextPackages) Deprecated.static jakarta.xml.bind.JAXBContextgetJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, boolean forceArrays, String key, ClassLoader cacheKey, Map<String, ?> properties) Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads.static jakarta.xml.bind.JAXBContextgetJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, String key) static jakarta.xml.bind.JAXBContextgetJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, String key, ClassLoader cacheKey, Map<String, ?> properties) Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads.static jakarta.xml.bind.JAXBContextgetJAXBContext(TreeSet<String> contextPackages, ClassLoader cacheKey) Deprecated.static jakarta.xml.bind.JAXBIntrospectorgetJAXBIntrospector(jakarta.xml.bind.JAXBContext context) get JAXB Introspectorstatic jakarta.xml.bind.MarshallergetJAXBMarshaller(jakarta.xml.bind.JAXBContext context) Get JAXBMarshallerstatic jakarta.xml.bind.UnmarshallergetJAXBUnmarshaller(jakarta.xml.bind.JAXBContext context) Get the unmarshaller.pruneDirectives(TreeSet<String> contextPackages) The contextPackages may declare overrides.static voidreleaseJAXBIntrospector(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.JAXBIntrospector introspector) Release JAXBIntrospector Do not call this method if an exception occurred while using the JAXBIntrospector.static voidreleaseJAXBMarshaller(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.Marshaller marshaller) releaseJAXBMarshalller Do not call this method if an exception occurred while using the Marshaller.static voidreleaseJAXBUnmarshaller(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.Unmarshaller unmarshaller) Release Unmarshaller Do not call this method if an exception occurred while using the Unmarshaller.
-
Field Details
-
DEFAULT_NAMESPACE_REMAP
-
-
Constructor Details
-
JAXBUtils
public JAXBUtils()
-
-
Method Details
-
getJAXBContext
public static jakarta.xml.bind.JAXBContext getJAXBContext(TreeSet<String> contextPackages) throws jakarta.xml.bind.JAXBException Deprecated.Get a JAXBContext for the class- Parameters:
contextPackage- Set- Returns:
- JAXBContext
- Throws:
jakarta.xml.bind.JAXBException
-
getJAXBContext
public static jakarta.xml.bind.JAXBContext getJAXBContext(TreeSet<String> contextPackages, ClassLoader cacheKey) throws jakarta.xml.bind.JAXBException Deprecated.Get a JAXBContext for the class Note: The contextPackage object is used by multiple threads. It should be considered immutable and not altered by this method.- Parameters:
contextPackage- SetcacheKey- ClassLoader- Returns:
- JAXBContext
- Throws:
jakarta.xml.bind.JAXBException
-
getJAXBContext
public static jakarta.xml.bind.JAXBContext getJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, String key) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
getJAXBContext
public static jakarta.xml.bind.JAXBContext getJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, String key, ClassLoader cacheKey, Map<String, ?> properties) throws jakarta.xml.bind.JAXBExceptionGet a JAXBContext for the class Note: The contextPackage object is used by multiple threads. It should be considered immutable and not altered by this method.- Parameters:
contextPackage- SetcontructionType- (output value that indicates how the context was constructed)cacheKey- ClassLoader- Returns:
- JAXBContext
- Throws:
jakarta.xml.bind.JAXBException
-
getJAXBContext
public static jakarta.xml.bind.JAXBContext getJAXBContext(TreeSet<String> contextPackages, jakarta.xml.ws.Holder<JAXBUtils.CONSTRUCTION_TYPE> constructionType, boolean forceArrays, String key, ClassLoader cacheKey, Map<String, ?> properties) throws jakarta.xml.bind.JAXBExceptionGet a JAXBContext for the class Note: The contextPackage object is used by multiple threads. It should be considered immutable and not altered by this method.- Parameters:
contextPackage- SetcontructionType- (output value that indicates how the context was constructed)forceArrays- (forces the returned JAXBContext to include the array types)cacheKey- ClassLoader- Returns:
- JAXBContext
- Throws:
jakarta.xml.bind.JAXBException
-
pruneDirectives
The contextPackages may declare overrides. Example: "com.A" "com.B" "com.C" "@com.A" <-- Indicates a reference to a class (versus ns 2 pkg conversion) "com.A > com.B" <-- This says com.A overrides com.B This method prunes the overrides and overriden packages. Example return: "com.A" "com.C"- Parameters:
contextPackages-- Returns:
- List
class references
-
getJAXBUnmarshaller
public static jakarta.xml.bind.Unmarshaller getJAXBUnmarshaller(jakarta.xml.bind.JAXBContext context) throws jakarta.xml.bind.JAXBException Get the unmarshaller. You must call releaseUnmarshaller to put it back into the pool- Parameters:
context- JAXBContext- Returns:
- Unmarshaller
- Throws:
jakarta.xml.bind.JAXBException
-
releaseJAXBUnmarshaller
public static void releaseJAXBUnmarshaller(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.Unmarshaller unmarshaller) Release Unmarshaller Do not call this method if an exception occurred while using the Unmarshaller. We object my be in an invalid state.- Parameters:
context- JAXBContextunmarshaller- Unmarshaller
-
getJAXBMarshaller
public static jakarta.xml.bind.Marshaller getJAXBMarshaller(jakarta.xml.bind.JAXBContext context) throws jakarta.xml.bind.JAXBException Get JAXBMarshaller- Parameters:
context- JAXBContext- Returns:
- Marshaller
- Throws:
jakarta.xml.bind.JAXBException
-
releaseJAXBMarshaller
public static void releaseJAXBMarshaller(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.Marshaller marshaller) releaseJAXBMarshalller Do not call this method if an exception occurred while using the Marshaller. We don't want an object in an invalid state.- Parameters:
context- JAXBContextmarshaller- Marshaller
-
getJAXBIntrospector
public static jakarta.xml.bind.JAXBIntrospector getJAXBIntrospector(jakarta.xml.bind.JAXBContext context) throws jakarta.xml.bind.JAXBException get JAXB Introspector- Parameters:
context- JAXBContext- Returns:
- JAXBIntrospector
- Throws:
jakarta.xml.bind.JAXBException
-
releaseJAXBIntrospector
public static void releaseJAXBIntrospector(jakarta.xml.bind.JAXBContext context, jakarta.xml.bind.JAXBIntrospector introspector) Release JAXBIntrospector Do not call this method if an exception occurred while using the JAXBIntrospector. We object my be in an invalid state.- Parameters:
context- JAXBContextintrospector- JAXBIntrospector
-