Class JAXBUtil
- java.lang.Object
-
- org.keycloak.saml.processing.core.util.JAXBUtil
-
public class JAXBUtil extends Object
Utility to obtain JAXB2 marshaller/unmarshaller etc- Since:
- May 26, 2009
- Author:
- Anil.Saldhana@redhat.com
-
-
Field Summary
Fields Modifier and Type Field Description static StringW3C_XML_SCHEMA_NS_URI
-
Constructor Summary
Constructors Constructor Description JAXBUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JAXBContextgetJAXBContext(Class<?> clazz)static JAXBContextgetJAXBContext(String path)static JAXBContextgetJAXBContext(String... paths)static MarshallergetMarshaller(String pkgName)Get the JAXB Marshallerstatic UnmarshallergetUnmarshaller(String pkgName)Get the JAXB Unmarshallerstatic UnmarshallergetUnmarshaller(String... pkgNames)Get the JAXB Unmarshaller for a selected set of package namesstatic MarshallergetValidatingMarshaller(String pkgName, String schemaLocation)Get the JAXB Marshallerstatic UnmarshallergetValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations)static UnmarshallergetValidatingUnmarshaller(String pkgName, String schemaLocation)Get the JAXB Unmarshaller
-
-
-
Field Detail
-
W3C_XML_SCHEMA_NS_URI
public static final String W3C_XML_SCHEMA_NS_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
getValidatingMarshaller
public static Marshaller getValidatingMarshaller(String pkgName, String schemaLocation) throws JAXBException, SAXException
Get the JAXB Marshaller- Parameters:
pkgName- The package name for the jaxb contextschemaLocation- location of the schema to validate against- Returns:
- Marshaller
- Throws:
JAXBExceptionSAXException
-
getMarshaller
public static Marshaller getMarshaller(String pkgName) throws JAXBException
Get the JAXB Marshaller- Parameters:
pkgName- The package name for the jaxb context- Returns:
- Marshaller
- Throws:
JAXBException
-
getUnmarshaller
public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException
Get the JAXB Unmarshaller- Parameters:
pkgName- The package name for the jaxb context- Returns:
- unmarshaller
- Throws:
JAXBException
-
getUnmarshaller
public static Unmarshaller getUnmarshaller(String... pkgNames) throws JAXBException
Get the JAXB Unmarshaller for a selected set of package names- Parameters:
pkgNames-- Returns:
- Throws:
JAXBException
-
getValidatingUnmarshaller
public static Unmarshaller getValidatingUnmarshaller(String pkgName, String schemaLocation) throws JAXBException, SAXException
Get the JAXB Unmarshaller- Parameters:
pkgName- The package name for the jaxb contextschemaLocation- location of the schema to validate against- Returns:
- unmarshaller
- Throws:
JAXBExceptionSAXException
-
getValidatingUnmarshaller
public static Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws JAXBException, SAXException, IOException
- Throws:
JAXBExceptionSAXExceptionIOException
-
getJAXBContext
public static JAXBContext getJAXBContext(String path) throws JAXBException
- Throws:
JAXBException
-
getJAXBContext
public static JAXBContext getJAXBContext(String... paths) throws JAXBException
- Throws:
JAXBException
-
getJAXBContext
public static JAXBContext getJAXBContext(Class<?> clazz) throws JAXBException
- Throws:
JAXBException
-
-