public class XMLReadWriteUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NAMESPACE_PREFIX |
static java.lang.String |
NAMESPACE_RDF |
static java.lang.String |
RDF_DEFAULT_PRE |
static java.lang.String |
SCHEMA_LOCATION |
static java.lang.String |
XSD_DEFAULT_PRE |
static java.lang.String |
XSI_DEFAULT_PRE |
Constructor and Description |
---|
XMLReadWriteUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDefaultNamespacePrefix(javax.xml.stream.XMLStreamWriter writer,
java.lang.String givenPrefix,
java.lang.String namespaceURI)
This method returns a predefined default prefix for a number of namespaces or, if the given namespace does not have a predefined prefix
and the given prefix was
null , DEFAULT_NAMESPACE_PREFIX . |
static java.lang.String |
getXSDPrefix(javax.xml.stream.XMLStreamWriter writer) |
static java.lang.String |
getXSIPrefix(javax.xml.stream.XMLStreamWriter writer) |
static void |
manageLiteralContentMetaNamespaces(XMLWriterStreamDataProvider streamDataProvider,
ReadWriteParameterMap parameters,
LiteralMetadataContentEvent event)
This method manages namespaces used or declared in any custom XML events depending on the parameter
ReadWriteParameterNames.KEY_CUSTOM_XML_NAMESPACE_HANDLING . |
static void |
writeCustomXML(javax.xml.stream.XMLStreamWriter writer,
ReadWriteParameterMap parameters,
javax.xml.stream.events.XMLEvent event) |
public static final java.lang.String XSI_DEFAULT_PRE
public static final java.lang.String XSD_DEFAULT_PRE
public static final java.lang.String RDF_DEFAULT_PRE
public static final java.lang.String SCHEMA_LOCATION
public static final java.lang.String NAMESPACE_RDF
public static final java.lang.String DEFAULT_NAMESPACE_PREFIX
public XMLReadWriteUtils()
public static java.lang.String getXSIPrefix(javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static java.lang.String getXSDPrefix(javax.xml.stream.XMLStreamWriter writer) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static java.lang.String getDefaultNamespacePrefix(javax.xml.stream.XMLStreamWriter writer, java.lang.String givenPrefix, java.lang.String namespaceURI) throws javax.xml.stream.XMLStreamException
null
, DEFAULT_NAMESPACE_PREFIX
.writer
- the currently used XMLStreamWriter
givenPrefix
- the prefix that shall be bound to a namespacenamespaceURI
- the namespace a prefix shall be bound tojavax.xml.stream.XMLStreamException
public static void writeCustomXML(javax.xml.stream.XMLStreamWriter writer, ReadWriteParameterMap parameters, javax.xml.stream.events.XMLEvent event) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static void manageLiteralContentMetaNamespaces(XMLWriterStreamDataProvider streamDataProvider, ReadWriteParameterMap parameters, LiteralMetadataContentEvent event) throws javax.xml.stream.XMLStreamException
ReadWriteParameterNames.KEY_CUSTOM_XML_NAMESPACE_HANDLING
. In case this parameter is set to false
or not set at all application developers need to make sure that all prefixes used in the custom XML are properly
declared within the custom XML. In case it is set to true
it is possible that the prefix a namespace is
bound to is altered. In both cases default namespace declarations are written to the according custom XML elements,
therefore these are never managed here.
Namespaces used in object values of type QName
are always managed.
streamDataProvider
- the StreamDataProvider used by the current writerevent
- the LiteralMetadataContentEvent containing some contentjavax.xml.stream.XMLStreamException
- if the underlying writer encounters an exception while writing