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 String
W3C_XML_SCHEMA_NS_URI
-
Constructor Summary
Constructors Constructor Description JAXBUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.xml.bind.JAXBContext
getJAXBContext(Class<?> clazz)
static javax.xml.bind.JAXBContext
getJAXBContext(String path)
static javax.xml.bind.JAXBContext
getJAXBContext(String... paths)
static javax.xml.bind.Marshaller
getMarshaller(String pkgName)
Get the JAXB Marshallerstatic javax.xml.bind.Unmarshaller
getUnmarshaller(String pkgName)
Get the JAXB Unmarshallerstatic javax.xml.bind.Unmarshaller
getUnmarshaller(String... pkgNames)
Get the JAXB Unmarshaller for a selected set of package namesstatic javax.xml.bind.Marshaller
getValidatingMarshaller(String pkgName, String schemaLocation)
Get the JAXB Marshallerstatic javax.xml.bind.Unmarshaller
getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations)
static javax.xml.bind.Unmarshaller
getValidatingUnmarshaller(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 javax.xml.bind.Marshaller getValidatingMarshaller(String pkgName, String schemaLocation) throws javax.xml.bind.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:
javax.xml.bind.JAXBException
SAXException
-
getMarshaller
public static javax.xml.bind.Marshaller getMarshaller(String pkgName) throws javax.xml.bind.JAXBException
Get the JAXB Marshaller- Parameters:
pkgName
- The package name for the jaxb context- Returns:
- Marshaller
- Throws:
javax.xml.bind.JAXBException
-
getUnmarshaller
public static javax.xml.bind.Unmarshaller getUnmarshaller(String pkgName) throws javax.xml.bind.JAXBException
Get the JAXB Unmarshaller- Parameters:
pkgName
- The package name for the jaxb context- Returns:
- unmarshaller
- Throws:
javax.xml.bind.JAXBException
-
getUnmarshaller
public static javax.xml.bind.Unmarshaller getUnmarshaller(String... pkgNames) throws javax.xml.bind.JAXBException
Get the JAXB Unmarshaller for a selected set of package names- Parameters:
pkgNames
-- Returns:
- Throws:
javax.xml.bind.JAXBException
-
getValidatingUnmarshaller
public static javax.xml.bind.Unmarshaller getValidatingUnmarshaller(String pkgName, String schemaLocation) throws javax.xml.bind.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:
javax.xml.bind.JAXBException
SAXException
-
getValidatingUnmarshaller
public static javax.xml.bind.Unmarshaller getValidatingUnmarshaller(String[] pkgNames, String[] schemaLocations) throws javax.xml.bind.JAXBException, SAXException, IOException
- Throws:
javax.xml.bind.JAXBException
SAXException
IOException
-
getJAXBContext
public static javax.xml.bind.JAXBContext getJAXBContext(String path) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
getJAXBContext
public static javax.xml.bind.JAXBContext getJAXBContext(String... paths) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
getJAXBContext
public static javax.xml.bind.JAXBContext getJAXBContext(Class<?> clazz) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
-