public class XMLReadWriteUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAMESPACE_PREFIX |
static String |
NAMESPACE_RDF |
static String |
RDF_DEFAULT_PRE |
static String |
SCHEMA_LOCATION |
static String |
XSD_DEFAULT_PRE |
static String |
XSI_DEFAULT_PRE |
Constructor and Description |
---|
XMLReadWriteUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultNamespacePrefix(XMLStreamWriter writer,
String givenPrefix,
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 String |
getXSDPrefix(XMLStreamWriter writer) |
static String |
getXSIPrefix(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(XMLStreamWriter writer,
ReadWriteParameterMap parameters,
XMLEvent event) |
public static final String XSI_DEFAULT_PRE
public static final String XSD_DEFAULT_PRE
public static final String RDF_DEFAULT_PRE
public static final String SCHEMA_LOCATION
public static final String NAMESPACE_RDF
public static final String DEFAULT_NAMESPACE_PREFIX
public XMLReadWriteUtils()
public static String getXSIPrefix(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static String getXSDPrefix(XMLStreamWriter writer) throws XMLStreamException
XMLStreamException
public static String getDefaultNamespacePrefix(XMLStreamWriter writer, String givenPrefix, String namespaceURI) throws 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 toXMLStreamException
public static void writeCustomXML(XMLStreamWriter writer, ReadWriteParameterMap parameters, XMLEvent event) throws XMLStreamException
XMLStreamException
public static void manageLiteralContentMetaNamespaces(XMLWriterStreamDataProvider streamDataProvider, ReadWriteParameterMap parameters, LiteralMetadataContentEvent event) throws 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 contentXMLStreamException
- if the underlying writer encounters an exception while writing