@Singleton @Visibility(value=LOCAL) public class XmlServiceImpl extends Object implements XmlService
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG_PARSING |
DEFAULT_NAMESPACE
Constructor and Description |
---|
XmlServiceImpl() |
Modifier and Type | Method and Description |
---|---|
<T> T |
createBean(Class<T> beanInterface)
This creates an instance of the given bean type
of with no fields of the bean filled
in.
|
<T> XmlRootHandle<T> |
createEmptyHandle(Class<T> jaxbAnnotationInterface)
This creates an empty handle (root will initially be null) corresponding to
the given interface class
|
<T> XmlRootHandle<T> |
createEmptyHandle(Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub)
This creates an empty handle (root will initially be null) corresponding to
the given interface class
|
ClassReflectionHelper |
getClassReflectionHelper() |
Map<String,String> |
getPackageNamespace(Class<?> clazz) |
XmlServiceParser |
getParser() |
ServiceLocator |
getServiceLocator() |
<T> void |
marshal(OutputStream outputStream,
XmlRootHandle<T> rootHandle)
Will marshal the given tree into the given stream.
|
<T> void |
marshal(OutputStream outputStream,
XmlRootHandle<T> rootHandle,
Map<String,Object> options)
Will marshal the given tree into the given stream.
|
<T> XmlRootHandle<T> |
unmarshal(InputStream input,
Class<T> jaxbAnnotatedInterface)
Unmarshals an XML stream using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(InputStream input,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub)
Unmarshals an XML stream using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(InputStream input,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub,
Map<String,Object> options)
Unmarshals an XML stream using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(URI uri,
Class<T> jaxbAnnotatedClassOrInterface)
Unmarshalls the given URI using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(URI uri,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub)
Unmarshalls the given URI using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(URI uri,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub,
Map<String,Object> options)
Unmarshalls the given URI using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(XMLStreamReader reader,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub)
Unmarshals an XML stream using the jaxb annotated interface.
|
<T> XmlRootHandle<T> |
unmarshal(XMLStreamReader reader,
Class<T> jaxbAnnotatedInterface,
boolean advertiseInRegistry,
boolean advertiseInHub,
Map<String,Object> options)
Unmarshals an XML stream using the jaxb annotated interface.
|
public <T> XmlRootHandle<T> unmarshal(URI uri, Class<T> jaxbAnnotatedClassOrInterface)
XmlService
XmlServiceParser
to parse the file.unmarshal
in interface XmlService
uri
- The non-null URI whereby to find the xml corresponding to the classpublic <T> XmlRootHandle<T> unmarshal(InputStream input, Class<T> jaxbAnnotatedInterface)
XmlService
XmlServiceParser
to parse the file.
The beans will be included in the service registry and the configuration
hub as appropriateunmarshal
in interface XmlService
input
- The non-null input stream to read. Will not close this streampublic <T> XmlRootHandle<T> unmarshal(URI uri, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub)
XmlService
XmlServiceParser
to parse the file.unmarshal
in interface XmlService
uri
- The non-null URI whereby to find the xml corresponding to the classadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)public <T> XmlRootHandle<T> unmarshal(URI uri, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub, Map<String,Object> options)
XmlService
XmlServiceParser
to parse the file.unmarshal
in interface XmlService
uri
- The non-null URI whereby to find the xml corresponding to the classadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)options
- optional (possibly null) options from the callerpublic <T> XmlRootHandle<T> unmarshal(XMLStreamReader reader, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub)
XmlService
unmarshal
in interface XmlService
reader
- The non-null XMLStreamReader representing the XML to be readadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)public <T> XmlRootHandle<T> unmarshal(XMLStreamReader reader, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub, Map<String,Object> options)
XmlService
unmarshal
in interface XmlService
reader
- The non-null XMLStreamReader representing the XML to be readadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)options
- optional (possibly null) options from the callerpublic <T> XmlRootHandle<T> unmarshal(InputStream input, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub)
XmlService
XmlServiceParser
to parse the file.unmarshal
in interface XmlService
input
- The non-null input stream to read. Will not close this streamadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)public <T> XmlRootHandle<T> unmarshal(InputStream input, Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub, Map<String,Object> options)
XmlService
XmlServiceParser
to parse the file.unmarshal
in interface XmlService
input
- The non-null input stream to read. Will not close this streamadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)options
- optional (possibly null) options from the callerpublic <T> XmlRootHandle<T> createEmptyHandle(Class<T> jaxbAnnotatedInterface, boolean advertiseInRegistry, boolean advertiseInHub)
XmlService
createEmptyHandle
in interface XmlService
jaxbAnnotatedInterface
- The non-null interface class corresponding to
the XML to be parsedadvertiseInRegistry
- if true the entire tree of parsed xml will be added to the
ServiceLocatoradvertiseInHub
- if true the entire tree of parsed xml will be added to the
HK2 configuration Hub (as bean-like maps)public <T> XmlRootHandle<T> createEmptyHandle(Class<T> jaxbAnnotationInterface)
XmlService
createEmptyHandle
in interface XmlService
jaxbAnnotationInterface
- The non-null interface class corresponding to
the XML to be parsedpublic <T> T createBean(Class<T> beanInterface)
XmlService
createBean
in interface XmlService
public <T> void marshal(OutputStream outputStream, XmlRootHandle<T> rootHandle) throws IOException
XmlService
marshal
in interface XmlService
outputStream
- A non-closed output stream. This method will
not close the output streamrootHandle
- A non-null root handle that may or may not
have been created with this XmlService implementationIOException
- On any exception that might happenpublic <T> void marshal(OutputStream outputStream, XmlRootHandle<T> rootHandle, Map<String,Object> options) throws IOException
XmlService
marshal
in interface XmlService
outputStream
- A non-closed output stream. This method will
not close the output streamrootHandle
- A non-null root handle that may or may not
have been created with this XmlService implementationoptions
- optional (possibly null) options from the callerIOException
- On any exception that might happenpublic ClassReflectionHelper getClassReflectionHelper()
public ServiceLocator getServiceLocator()
public XmlServiceParser getParser()
Copyright © 2009–2023 Oracle Corporation. All rights reserved.