C
- containerN
- nodepublic abstract class ToXml<C,N> extends XmlAligner
Modifier and Type | Field and Description |
---|---|
static String |
MSG_CANNOT_NOT_FIND_ELEMENT_DECLARATION |
static String |
MSG_EXPECTED_ELEMENT |
static String |
MSG_INVALID_CONTENT |
String |
XSI_PREFIX_MAPPING |
FEATURE_NAMESPACE_PREFIXES, FEATURE_NAMESPACES, log, validatorHandler, XML_SCHEMA_INSTANCE_NAMESPACE, XML_SCHEMA_NIL_ATTRIBUTE
Constructor and Description |
---|
ToXml(ValidatorHandler validatorHandler,
List<org.apache.xerces.xs.XSModel> schemaInformation) |
Modifier and Type | Method and Description |
---|---|
Source |
asSource(C container)
Obtain the XmlAligner as a
Source that can be used as input of a Transformer . |
String |
findNamespaceForName(String name) |
abstract Map<String,String> |
getAttributes(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
List<org.apache.xerces.xs.XSParticle> |
getBestChildElementPath(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node,
boolean silent) |
boolean |
getBestMatchingElementPath(org.apache.xerces.xs.XSElementDeclaration baseElementDeclaration,
N baseNode,
org.apache.xerces.xs.XSParticle particle,
List<org.apache.xerces.xs.XSParticle> path,
List<String> failureReasons) |
abstract Iterable<N> |
getChildrenByName(N node,
org.apache.xerces.xs.XSElementDeclaration childElementDeclaration) |
String |
getNamespacePrefix(String uri) |
String |
getNodeNamespaceURI(N node)
return namespace of node, if known.
|
String |
getQName(String namespace,
String name) |
abstract N |
getRootNode(C container) |
abstract String |
getText(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
protected Set<String> |
getUnprocessedChildElementNames(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node,
Set<String> processedChildren) |
protected void |
handleComplexTypedElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
void |
handleElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
void |
handleElementContents(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
void |
handleError(SAXException e) |
void |
handleError(String msg) |
void |
handleRootNode(C container,
String name,
String nodeNamespace)
Pushes node through validator.
|
protected void |
handleSimpleTypedElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
org.apache.xerces.xs.XSSimpleTypeDefinition simpleTypeDefinition,
N node) |
abstract boolean |
hasChild(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node,
String childName) |
abstract boolean |
isNil(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
N node) |
void |
parse(InputSource input)
Start the parse, obtain the container to parse from the InputSource when set by
asSource(Object) . |
protected void |
processChildElement(N node,
String parentName,
org.apache.xerces.xs.XSElementDeclaration childElementDeclaration,
boolean mandatory,
Set<String> processedChildren) |
protected void |
sendString(String string) |
void |
startParse(C container)
Align the XML according to the schema.
|
String |
translate(C data) |
void |
translate(C data,
ContentHandler handler) |
collectChildElements, determineIsParentOfSingleMultipleOccurringChildElement, endElement, findElementDeclarationForName, findElementDeclarationsForName, findMultipleOccurringChildElements, getAttributeUses, getAttributeUses, getElementType, getSchemaInformation, getTypeDefinition, getValidatorHandler, handleRecoverableError, isMultipleOccurringChildElement, isMultipleOccurringChildInParentElement, isNil, isPresentInSet, newLine, newLine, setFeature, startElement, typeContainsWildcard
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, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public final String XSI_PREFIX_MAPPING
public static final String MSG_EXPECTED_ELEMENT
public static final String MSG_INVALID_CONTENT
public static final String MSG_CANNOT_NOT_FIND_ELEMENT_DECLARATION
public ToXml(ValidatorHandler validatorHandler, List<org.apache.xerces.xs.XSModel> schemaInformation)
public String getNodeNamespaceURI(N node)
public Source asSource(C container)
Source
that can be used as input of a Transformer
.public void parse(InputSource input) throws SAXException, IOException
asSource(Object)
.
Normally, the parse is started via {#startParse(C container)}, but this implementation allows asSource(Object)
to function.parse
in interface XMLReader
parse
in class XMLFilterImpl
SAXException
IOException
public void startParse(C container) throws SAXException
SAXException
public abstract Map<String,String> getAttributes(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node) throws SAXException
SAXException
public abstract boolean hasChild(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node, String childName) throws SAXException
SAXException
public abstract Iterable<N> getChildrenByName(N node, org.apache.xerces.xs.XSElementDeclaration childElementDeclaration) throws SAXException
SAXException
public abstract boolean isNil(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node)
public abstract String getText(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node)
protected Set<String> getUnprocessedChildElementNames(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node, Set<String> processedChildren) throws SAXException
SAXException
public void handleRootNode(C container, String name, String nodeNamespace) throws SAXException
SAXException
public void handleElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node) throws SAXException
SAXException
public void handleElementContents(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node) throws SAXException
SAXException
protected void handleComplexTypedElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node) throws SAXException
SAXException
protected void handleSimpleTypedElement(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, org.apache.xerces.xs.XSSimpleTypeDefinition simpleTypeDefinition, N node) throws SAXException
SAXException
protected void processChildElement(N node, String parentName, org.apache.xerces.xs.XSElementDeclaration childElementDeclaration, boolean mandatory, Set<String> processedChildren) throws SAXException
SAXException
public List<org.apache.xerces.xs.XSParticle> getBestChildElementPath(org.apache.xerces.xs.XSElementDeclaration elementDeclaration, N node, boolean silent) throws SAXException
SAXException
public boolean getBestMatchingElementPath(org.apache.xerces.xs.XSElementDeclaration baseElementDeclaration, N baseNode, org.apache.xerces.xs.XSParticle particle, List<org.apache.xerces.xs.XSParticle> path, List<String> failureReasons) throws SAXException
baseElementDeclaration
- TODOparticle
- failureReasons
- returns the reasons why no match was foundpath
- in this list the longest list of child elements, that matches the available, is maintained. Null if no matching.SAXException
protected void sendString(String string) throws SAXException
SAXException
public void handleError(String msg) throws SAXException
SAXException
public void handleError(SAXException e) throws SAXException
SAXException
public String getQName(String namespace, String name) throws SAXException
SAXException
public String getNamespacePrefix(String uri) throws SAXException
SAXException
public String findNamespaceForName(String name) throws SAXException
SAXException
public void translate(C data, ContentHandler handler) throws SAXException
SAXException
public String translate(C data) throws SAXException
SAXException
Copyright © 2023 Frank!Framework. All rights reserved.