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 String
static final String
static final String
static final String
static final String
static final String
Fields 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 aSource
that can be used as input of aTransformer
.static Json2Xml
create
(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) void
parse
(InputSource input) Start the parse, obtain the container to parse from the InputSource when set byasSource(JsonValue)
.void
setOverrideValues
(Map<String, Object> overrideValues) void
setSubstitutionProvider
(SubstitutionProvider<?> substitutions) void
startParse
(jakarta.json.JsonValue node) static String
translate
(jakarta.json.JsonStructure jsonStructure, URL schemaURL, boolean compactJsonArrays, String rootElement, String targetNamespace) Helper method for teststranslate
(jakarta.json.JsonValue data) void
translate
(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, typeContainsWildcard
Methods 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, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 aSource
that 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:
parse
in interfaceXMLReader
- Overrides:
parse
in classXMLFilterImpl
- Throws:
SAXException
IOException
-
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
-