Package org.qdl_lang.xml
Class XMLUtilsV2
- java.lang.Object
-
- org.qdl_lang.xml.XMLUtilsV2
-
public class XMLUtilsV2 extends Object
XML Utilities for version 2 of serialization.Created by Jeff Gaynor
on 2/15/22 at 6:36 AM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XMLUtilsV2.StateAttributes
-
Constructor Summary
Constructors Constructor Description XMLUtilsV2()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deserializeExtrinsicFunctions(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeExtrinsicVariables(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeFunctions(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeInstances(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeIntrinsicFunctions(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeIntrinsicVariables(XMLEventReader xer, State state, SerializationState serializationState)
static void
deserializeStateStore(XMLEventReader xer, SerializationState SerializationState)
static Module
deserializeTemplate(XMLEventReader xer, XMLUtils.ModuleAttributes moduleAttributes, SerializationState serializationState)
Deserializes a single template, either from sources or from the class reference.static void
deserializeTemplates(XMLEventReader xer, State state, SerializationState serializationState)
Deserializes a template stack of references.static void
deserializeTemplateStore(XMLEventReader xer, SerializationState SerializationState)
static void
deserializeVariables(XMLEventReader xer, State state, SerializationState serializationState)
protected static void
deserializeXStack(XMLEventReader xer, XStack xStack, State state, SerializationState serializationState)
static XMLUtilsV2.StateAttributes
getStateAttributes(XMLEvent xe)
static String
getText(XMLEventReader xer, String closeTag)
This will read the text contents of a tag.static void
toCDATA(XMLStreamWriter xsw, Collection collection)
Converts a collection to aJSONArray
then to a string.
-
-
-
Method Detail
-
deserializeTemplateStore
public static void deserializeTemplateStore(XMLEventReader xer, SerializationState SerializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeStateStore
public static void deserializeStateStore(XMLEventReader xer, SerializationState SerializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeTemplate
public static Module deserializeTemplate(XMLEventReader xer, XMLUtils.ModuleAttributes moduleAttributes, SerializationState serializationState) throws XMLStreamException
Deserializes a single template, either from sources or from the class reference.- Parameters:
xer
-moduleAttributes
-serializationState
-- Returns:
- Throws:
XMLStreamException
-
deserializeTemplates
public static void deserializeTemplates(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
Deserializes a template stack of references.- Parameters:
xer
-serializationState
-- Throws:
XMLStreamException
-
deserializeVariables
public static void deserializeVariables(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeFunctions
public static void deserializeFunctions(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeInstances
public static void deserializeInstances(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeExtrinsicVariables
public static void deserializeExtrinsicVariables(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeExtrinsicFunctions
public static void deserializeExtrinsicFunctions(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeIntrinsicVariables
public static void deserializeIntrinsicVariables(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeIntrinsicFunctions
public static void deserializeIntrinsicFunctions(XMLEventReader xer, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
deserializeXStack
protected static void deserializeXStack(XMLEventReader xer, XStack xStack, State state, SerializationState serializationState) throws XMLStreamException
- Throws:
XMLStreamException
-
getStateAttributes
public static XMLUtilsV2.StateAttributes getStateAttributes(XMLEvent xe)
-
getText
public static String getText(XMLEventReader xer, String closeTag) throws XMLStreamException
This will read the text contents of a tag. The assumption is that you have the cursor on the start tag then call this. It sifts through whitespace etc. until it finds actual characters, then returns. If it finds only white space, it returns the empty string.- Parameters:
xer
-closeTag
-- Returns:
- Throws:
XMLStreamException
-
toCDATA
public static void toCDATA(XMLStreamWriter xsw, Collection collection) throws XMLStreamException
Converts a collection to aJSONArray
then to a string. This is the compliment togetText(XMLEventReader, String)
.Use
You write the start element, invoke this, then write the end element.- Parameters:
xsw
-collection
-- Throws:
XMLStreamException
-
-