Package org.frankframework.align
Class Json2Xml
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
org.frankframework.align.XmlAligner
org.frankframework.align.Json2Xml
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler,XMLFilter,XMLReader
XML Schema guided JSON to XML converter;
- Author:
- Gerrit van Brakel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.frankframework.align.XmlAligner
FEATURE_NAMESPACE_PREFIXES, FEATURE_NAMESPACES, validatorHandler, XML_SCHEMA_INSTANCE_NAMESPACE, XML_SCHEMA_NIL_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionJson2Xml(ValidatorHandler validatorHandler, List<org.apache.xerces.xs.XSModel> schemaInformation, boolean insertElementContainerElements, String rootElement, boolean strictSyntax) -
Method Summary
Modifier and TypeMethodDescriptionasSource(jakarta.json.JsonValue container) Obtain the XmlAligner as aSourcethat can be used as input of aTransformer.static Json2Xmlcreate(URL schemaURL, boolean compactJsonArrays, String rootElement, boolean strictSyntax, boolean deepSearch, String targetNamespace, Map<String, Object> overrideValues) Helper method for testsList<org.apache.xerces.xs.XSParticle> getBestChildElementPath(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, jakarta.json.JsonValue node, boolean silent) voidparse(InputSource input) Start the parse, obtain the container to parse from the InputSource when set byasSource(JsonValue).voidsetOverrideValues(Map<String, Object> overrideValues) voidsetSubstitutionProvider(SubstitutionProvider<?> substitutions) voidstartParse(jakarta.json.JsonValue node) static Stringtranslate(jakarta.json.JsonStructure jsonStructure, URL schemaURL, boolean compactJsonArrays, String rootElement, String targetNamespace) Helper method for teststranslate(jakarta.json.JsonValue data) voidtranslate(jakarta.json.JsonValue data, ContentHandler handler) Methods inherited from class org.frankframework.align.XmlAligner
collectChildElements, endElement, findElementDeclarationForName, findElementDeclarationsForName, findMultipleOccurringChildElements, getAttributeUses, getAttributeUses, getElementType, getSchemaInformation, getTypeDefinition, getValidatorHandler, handleRecoverableError, isMultipleOccurringChildElement, isMultipleOccurringChildInParentElement, isNil, isPresentInSet, newLine, setFeature, startDocument, startElement, typeContainsWildcardMethods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setParent, setProperty, skippedEntity, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
MSG_FULL_INPUT_IN_STRICT_COMPACTING_MODE
- See Also:
-
MSG_EXPECTED_SINGLE_ELEMENT
- See Also:
-
XSI_PREFIX_MAPPING
- See Also:
-
MSG_EXPECTED_ELEMENT
- See Also:
-
MSG_CANNOT_NOT_FIND_ELEMENT_DECLARATION
- See Also:
-
XSD_WILDCARD_ELEMENT_TOKEN
- See Also:
-
-
Constructor Details
-
Json2Xml
public Json2Xml(ValidatorHandler validatorHandler, List<org.apache.xerces.xs.XSModel> schemaInformation, boolean insertElementContainerElements, String rootElement, boolean strictSyntax)
-
-
Method Details
-
startParse
- Throws:
SAXException
-
translate
public static String translate(jakarta.json.JsonStructure jsonStructure, URL schemaURL, boolean compactJsonArrays, String rootElement, String targetNamespace) throws SAXException Helper method for tests- Throws:
SAXException
-
create
public static Json2Xml create(URL schemaURL, boolean compactJsonArrays, String rootElement, boolean strictSyntax, boolean deepSearch, String targetNamespace, Map<String, Object> overrideValues) throws SAXExceptionHelper method for tests- Throws:
SAXException
-
setSubstitutionProvider
-
setOverrideValues
-
asSource
Obtain the XmlAligner as aSourcethat can be used as input of aTransformer. -
parse
Start the parse, obtain the container to parse from the InputSource when set byasSource(JsonValue). Normally, the parse is started via {#startParse(C container)}, but this implementation allowsasSource(JsonValue)to function.- Specified by:
parsein interfaceXMLReader- Overrides:
parsein classXMLFilterImpl- Throws:
SAXExceptionIOException
-
getBestChildElementPath
@Nonnull public List<org.apache.xerces.xs.XSParticle> getBestChildElementPath(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, jakarta.json.JsonValue node, boolean silent) throws SAXException - Throws:
SAXException
-
translate
- Throws:
SAXException
-
translate
- Throws:
SAXException
-