Package com.ibm.fhir.model.util
Class XMLSupport
- java.lang.Object
-
- com.ibm.fhir.model.util.XMLSupport
-
public final class XMLSupport extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XMLSupport.StreamReaderDelegate
Simple subclass ofStreamReaderDelegate
to make it AutoCloseablestatic class
XMLSupport.StreamWriterDelegate
The corollary toStreamReaderDelegate
.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FHIR_NS_URI
static java.lang.String
XHTML_NS_URI
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
checkElementOrder(java.lang.String elementName, int current, int previous, boolean repeating)
Checks the order of the current element using its position relative to the position of the previous elementstatic XMLSupport.StreamWriterDelegate
createNonClosingStreamWriterDelegate(javax.xml.stream.XMLStreamWriter writer)
static XMLSupport.StreamReaderDelegate
createStreamReaderDelegate(java.io.InputStream in)
static XMLSupport.StreamReaderDelegate
createStreamReaderDelegate(java.io.Reader reader)
static XMLSupport.StreamWriterDelegate
createStreamWriterDelegate(java.io.OutputStream out)
static XMLSupport.StreamWriterDelegate
createStreamWriterDelegate(java.io.Writer writer)
static javax.xml.transform.Transformer
createTransformer()
static javax.xml.stream.XMLStreamReader
createXMLStreamReader(java.io.InputStream in)
static javax.xml.stream.XMLStreamReader
createXMLStreamReader(java.io.Reader reader)
static javax.xml.stream.XMLStreamWriter
createXMLStreamWriter(java.io.OutputStream out)
static javax.xml.stream.XMLStreamWriter
createXMLStreamWriter(java.io.Writer writer)
static void
init()
Calling this method allows us to load/initialize this class during startup.static boolean
isResourceContainer(java.lang.String elementName)
static java.lang.String
parseDiv(javax.xml.stream.XMLStreamReader reader)
static void
requireNamespace(javax.xml.stream.XMLStreamReader reader, java.lang.String namespaceURI)
-
-
-
Field Detail
-
FHIR_NS_URI
public static final java.lang.String FHIR_NS_URI
- See Also:
- Constant Field Values
-
XHTML_NS_URI
public static final java.lang.String XHTML_NS_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static void init()
Calling this method allows us to load/initialize this class during startup.
-
checkElementOrder
public static int checkElementOrder(java.lang.String elementName, int current, int previous, boolean repeating)
Checks the order of the current element using its position relative to the position of the previous element- Parameters:
elementName
- the name of the current elementcurrent
- the position of the current element in the sequenceprevious
- the position of the previous element in the sequencerepeating
- true if the element is allowed to repeat- Returns:
- the position of the current element
- Throws:
java.lang.IllegalArgumentException
- if the element is out of order or if the parser has already seen the element and it is not allowed to repeat
-
createStreamReaderDelegate
public static XMLSupport.StreamReaderDelegate createStreamReaderDelegate(java.io.InputStream in) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createStreamReaderDelegate
public static XMLSupport.StreamReaderDelegate createStreamReaderDelegate(java.io.Reader reader) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createStreamWriterDelegate
public static XMLSupport.StreamWriterDelegate createStreamWriterDelegate(java.io.OutputStream out) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createStreamWriterDelegate
public static XMLSupport.StreamWriterDelegate createStreamWriterDelegate(java.io.Writer writer) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamReader
public static javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.Reader reader) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamWriter
public static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.OutputStream out) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createXMLStreamWriter
public static javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.io.Writer writer) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
isResourceContainer
public static boolean isResourceContainer(java.lang.String elementName)
-
parseDiv
public static java.lang.String parseDiv(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
requireNamespace
public static void requireNamespace(javax.xml.stream.XMLStreamReader reader, java.lang.String namespaceURI) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
createNonClosingStreamWriterDelegate
public static XMLSupport.StreamWriterDelegate createNonClosingStreamWriterDelegate(javax.xml.stream.XMLStreamWriter writer)
-
createTransformer
public static javax.xml.transform.Transformer createTransformer()
-
-