Package org.apache.cxf.common.jaxb
Class JAXBUtils
java.lang.Object
org.apache.cxf.common.jaxb.JAXBUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
static enum
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
builtInTypeToJavaType
(String type) static void
closeUnmarshaller
(javax.xml.bind.Unmarshaller u) static JAXBUtils.BridgeWrapper
createBridge
(Set<Class<?>> ctxClasses, QName qname, Class<?> refcls, Annotation[] anns) static Object
static Object
createFileCodeWriter
(File f, String encoding) static JAXBContextProxy
createJAXBContextProxy
(javax.xml.bind.JAXBContext ctx) static JAXBContextProxy
createJAXBContextProxy
(javax.xml.bind.JAXBContext ctx, SchemaCollection collection, String defaultNs) static Object
createMininumEscapeHandler
(Class<?> cls) static Object
createNoEscapeHandler
(Class<?> cls) static JAXBUtils.SchemaCompiler
static JAXBUtils.SchemaCompiler
createSchemaCompilerWithDefaultAllocator
(Set<String> allocatorSet) generateJaxbSchemas
(javax.xml.bind.JAXBContext context, Map<String, DOMResult> builtIns) static JAXBBeanInfo
getBeanInfo
(JAXBContextProxy context, Class<?> cls) getGeneratedClassNames
(JAXBUtils.JCodeModel codeModel) static String
getPackageNamespace
(Class<?> cls) static Class<?>
getParamClass
(JAXBUtils.SchemaCompiler sc, String method) static Class<?>
getValidClass
(Class<?> cls) static Class<?>
holderClass
(String type) protected static boolean
isJavaKeyword
(String word) Checks if the specified word is a Java keyword (as defined in JavaUtils).static boolean
isJAXB22()
static void
logGeneratedClassNames
(Logger logger, JAXBUtils.JCodeModel codeModel) static String
namespaceURIToPackage
(String namespaceURI) Generates a Java package name from a URI according to the algorithm outlined in JAXB 2.0.static String
nameSpaceURIToPackage
(URI uri) Generates a Java package name from a URI according to the algorithm outlined in Appendix D of JAXB (2.0+).static String
nameToIdentifier
(String name, JAXBUtils.IdentifierType type) Converts an XML name to a Java identifier according to the mapping algorithm outlined in the JAXB specificationstatic void
scanPackages
(Set<Class<?>> classes, Class<?>[] extraClass, Map<Package, CachedClass> objectFactoryCache) static void
scanPackages
(Set<Class<?>> classes, Map<Package, CachedClass> objectFactoryCache) static void
setEscapeHandler
(javax.xml.bind.Marshaller marshaller, Object escapeHandler) static void
setMinimumEscapeHandler
(javax.xml.bind.Marshaller marshaller) static Object
setNamespaceMapper
(Bus bus, Map<String, String> nspref, javax.xml.bind.Marshaller marshaller) static void
setNoEscapeHandler
(javax.xml.bind.Marshaller marshaller) static Object
unmarshall
(javax.xml.bind.JAXBContext c, XMLStreamReader reader) static <T> javax.xml.bind.JAXBElement<T>
unmarshall
(javax.xml.bind.JAXBContext c, XMLStreamReader reader, Class<T> cls) static Object
unmarshall
(javax.xml.bind.JAXBContext c, Source s) static Object
unmarshall
(javax.xml.bind.JAXBContext c, Element e) static <T> javax.xml.bind.JAXBElement<T>
unmarshall
(javax.xml.bind.JAXBContext c, Element e, Class<T> cls)
-
Field Details
-
JAXB_URI
- See Also:
-
-
Method Details
-
closeUnmarshaller
public static void closeUnmarshaller(javax.xml.bind.Unmarshaller u) -
unmarshall
public static Object unmarshall(javax.xml.bind.JAXBContext c, Element e) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
unmarshall
public static <T> javax.xml.bind.JAXBElement<T> unmarshall(javax.xml.bind.JAXBContext c, Element e, Class<T> cls) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
unmarshall
public static Object unmarshall(javax.xml.bind.JAXBContext c, Source s) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
unmarshall
public static <T> javax.xml.bind.JAXBElement<T> unmarshall(javax.xml.bind.JAXBContext c, XMLStreamReader reader, Class<T> cls) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
unmarshall
public static Object unmarshall(javax.xml.bind.JAXBContext c, XMLStreamReader reader) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
builtInTypeToJavaType
-
holderClass
-
isJavaKeyword
Checks if the specified word is a Java keyword (as defined in JavaUtils).- Parameters:
word
- the word to check.- Returns:
- true if the word is a keyword.
- See Also:
-
namespaceURIToPackage
Generates a Java package name from a URI according to the algorithm outlined in JAXB 2.0.- Parameters:
namespaceURI
- the namespace URI.- Returns:
- the package name.
-
nameSpaceURIToPackage
Generates a Java package name from a URI according to the algorithm outlined in Appendix D of JAXB (2.0+).- Parameters:
uri
- the namespace URI.- Returns:
- the package name.
-
nameToIdentifier
Converts an XML name to a Java identifier according to the mapping algorithm outlined in the JAXB specification- Parameters:
name
- the XML name- Returns:
- the Java identifier
-
getValidClass
-
setNamespaceMapper
public static Object setNamespaceMapper(Bus bus, Map<String, String> nspref, javax.xml.bind.Marshaller marshaller) throws javax.xml.bind.PropertyException- Throws:
javax.xml.bind.PropertyException
-
createBridge
public static JAXBUtils.BridgeWrapper createBridge(Set<Class<?>> ctxClasses, QName qname, Class<?> refcls, Annotation[] anns) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
createSchemaCompiler
- Throws:
javax.xml.bind.JAXBException
-
createSchemaCompilerWithDefaultAllocator
public static JAXBUtils.SchemaCompiler createSchemaCompilerWithDefaultAllocator(Set<String> allocatorSet) -
logGeneratedClassNames
-
getGeneratedClassNames
-
createFileCodeWriter
- Throws:
javax.xml.bind.JAXBException
-
createFileCodeWriter
public static Object createFileCodeWriter(File f, String encoding) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
getParamClass
-
generateJaxbSchemas
public static List<DOMResult> generateJaxbSchemas(javax.xml.bind.JAXBContext context, Map<String, DOMResult> builtIns) throws IOException- Throws:
IOException
-
getPackageNamespace
-
scanPackages
-
scanPackages
-
isJAXB22
public static boolean isJAXB22() -
createJAXBContextProxy
-
createJAXBContextProxy
public static JAXBContextProxy createJAXBContextProxy(javax.xml.bind.JAXBContext ctx, SchemaCollection collection, String defaultNs) -
getBeanInfo
-
setMinimumEscapeHandler
public static void setMinimumEscapeHandler(javax.xml.bind.Marshaller marshaller) -
setNoEscapeHandler
public static void setNoEscapeHandler(javax.xml.bind.Marshaller marshaller) -
setEscapeHandler
-
createMininumEscapeHandler
-
createNoEscapeHandler
-