Class Json2XmlValidator

    • Constructor Detail

      • Json2XmlValidator

        public Json2XmlValidator()
    • Method Detail

      • getJsonRootValidations

        protected RootValidations getJsonRootValidations​(boolean responseMode)
      • createJsonSchema

        public jakarta.json.JsonStructure createJsonSchema​(String elementName)
      • createJsonSchema

        public jakarta.json.JsonStructure createJsonSchema​(String elementName,
                                                           String namespace)
      • setTargetNamespace

        public void setTargetNamespace​(String targetNamespace)
        Only for JSON input: namespace of the resulting XML. Need only be specified when the namespace of root name is ambiguous in the schema
      • setOutputFormat

        public void setOutputFormat​(DocumentFormat outputFormat)
        Default format of the result, that is used if the format cannot be found from outputFormatSessionKey or from inputFormatSessionKey (when validating responses and autoFormat=true)
        Default value
      • setOutputFormatSessionKey

        public void setOutputFormatSessionKey​(String outputFormatSessionKey)
        Session key to retrieve outputFormat from
        Default value
      • setInputFormatSessionKey

        public void setInputFormatSessionKey​(String inputFormatSessionKey)
        Session key to store the inputFormat in, to be able to set the outputformat when autoFormat=true. Can also be used to pass the value of an HTTP Accept header, to obtain a properly formatted response
        Default value
        "Json2XmlValidator.inputFormat "<name of the pipe>
      • setAutoFormat

        public void setAutoFormat​(boolean autoFormat)
        If true, the format on 'output' is set to the same as the format of the input message on 'input'. The format of the input message is stored in and retrieved from the session variable specified by outputFormatSessionKey
        Default value
      • setCompactJsonArrays

        public void setCompactJsonArrays​(boolean compactJsonArrays)
        If true assume arrays in JSON do not have the element containers like in XML
        Default value
      • setStrictJsonArraySyntax

        public void setStrictJsonArraySyntax​(boolean strictJsonArraySyntax)
        If true check that incoming JSON adheres to the specified syntax (compact or full), otherwise both types are accepted for conversion from JSON to XML
        Default value
      • setJsonWithRootElements

        public void setJsonWithRootElements​(boolean jsonWithRootElements)
        If true, assume that JSON contains/must contain a root element
        Default value
      • setDeepSearch

        public void setDeepSearch​(boolean deepSearch)
        If true, and converting from JSON to XML, parameter substitutions are searched for optional sub elements too. By default, only mandatory elements are searched for parameter substitutions. N.B. Currently this option might cause problems. Please try using more qualified parameters names (using '/') first
        Default value
      • setIgnoreUndeclaredElements

        public void setIgnoreUndeclaredElements​(boolean ignoreUndeclaredElements)
        If true, and converting from JSON to XML, elements in JSON that are not found in the XML Schema are ignored
        Default value
      • setFailOnWildcards

        public void setFailOnWildcards​(boolean failOnWildcards)
        If true, an exception is thrown when a wildcard is found in the XML Schema when parsing an object. This often indicates that an element is not properly typed in the XML Schema, and could lead to ambuigities.
        Default value
      • setAcceptNamespacelessXml

        public void setAcceptNamespacelessXml​(boolean acceptNamespacelessXml)
        If true, all XML is allowed to be without namespaces. If no namespaces are detected (by the presence of the string 'xmlns') in the XML, the root namespace is added to the XML
        Default value
      • setAcceptNamespaceLessXml

        @ConfigurationWarning("The attribute \'acceptNamespaceLessXml\' has been renamed \'acceptNamespacelessXml\'")
        public void setAcceptNamespaceLessXml​(boolean acceptNamespacelessXml)
      • setProduceNamespacelessXml

        public void setProduceNamespacelessXml​(boolean produceNamespacelessXml)
        If true, all XML that is generated is without a namespace set
        Default value
      • setProduceNamespaceLessXml

        @ConfigurationWarning("The attribute \'produceNamespaceLessXml\' has been renamed \'produceNamespacelessXml\'")
        public void setProduceNamespaceLessXml​(boolean produceNamespacelessXml)
      • setValidateJsonToRootElementOnly

        public void setValidateJsonToRootElementOnly​(boolean validateJsonToRootElementOnly)
        If true, and converting to or from JSON, then the message root is the only rootValidation, ignoring root validations like for SOAP envelope and header set by descender classes like SoapValidator
        Default value
      • setAllowJson

        public void setAllowJson​(boolean allowJson)
        Allow JSON input
        Default value
      • isCompactJsonArrays

        public boolean isCompactJsonArrays()
      • isStrictJsonArraySyntax

        public boolean isStrictJsonArraySyntax()
      • isJsonWithRootElements

        public boolean isJsonWithRootElements()
      • isDeepSearch

        public boolean isDeepSearch()
      • isIgnoreUndeclaredElements

        public boolean isIgnoreUndeclaredElements()
      • getTargetNamespace

        public String getTargetNamespace()
      • isAutoFormat

        public boolean isAutoFormat()
      • getInputFormatSessionKey

        public String getInputFormatSessionKey()
      • getOutputFormatSessionKey

        public String getOutputFormatSessionKey()
      • isFailOnWildcards

        public boolean isFailOnWildcards()
      • isAcceptNamespacelessXml

        public boolean isAcceptNamespacelessXml()
      • isProduceNamespacelessXml

        public boolean isProduceNamespacelessXml()
      • isValidateJsonToRootElementOnly

        public boolean isValidateJsonToRootElementOnly()
      • isAllowJson

        public boolean isAllowJson()