Class XMLSupport
- java.lang.Object
-
- org.linuxforhealth.fhir.model.util.XMLSupport
-
public final class XMLSupport extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLSupport.StreamReaderDelegateSimple subclass ofStreamReaderDelegateto make it AutoCloseablestatic classXMLSupport.StreamWriterDelegateThe corollary toStreamReaderDelegate.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFHIR_NS_URIstatic java.lang.StringXHTML_NS_URI
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcheckElementOrder(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.StreamWriterDelegatecreateNonClosingStreamWriterDelegate(javax.xml.stream.XMLStreamWriter writer)static XMLSupport.StreamReaderDelegatecreateStreamReaderDelegate(java.io.InputStream in)static XMLSupport.StreamReaderDelegatecreateStreamReaderDelegate(java.io.Reader reader)static XMLSupport.StreamWriterDelegatecreateStreamWriterDelegate(java.io.OutputStream out)static XMLSupport.StreamWriterDelegatecreateStreamWriterDelegate(java.io.Writer writer)static javax.xml.transform.TransformercreateTransformer()static javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.io.InputStream in)static javax.xml.stream.XMLStreamReadercreateXMLStreamReader(java.io.Reader reader)static javax.xml.stream.XMLStreamWritercreateXMLStreamWriter(java.io.OutputStream out)static javax.xml.stream.XMLStreamWritercreateXMLStreamWriter(java.io.Writer writer)static voidinit()Calling this method allows us to load/initialize this class during startup.static booleanisResourceContainer(java.lang.String elementName)static java.lang.StringparseDiv(javax.xml.stream.XMLStreamReader reader)static voidrequireNamespace(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()
-
-