Package org.apache.camel.xml.in
Class BaseParser
java.lang.Object
org.apache.camel.xml.in.BaseParser
- Direct Known Subclasses:
ModelParser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected static interfaceprotected static interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseParser(InputStream input) BaseParser(InputStream input, String namespace) BaseParser(Reader reader) BaseParser(Reader reader, String namespace) BaseParser(org.apache.camel.spi.Resource resource) BaseParser(org.apache.camel.spi.Resource resource, String namespace) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSecondaryNamespace(String namespace) protected byte[]asByteArray(String val) protected Class<?> protected Class<?>[]asClassArray(String val) asStringList(String val) asStringSet(String val) protected <T> voidprotected voidprotected <T> voiddoAddValues(List<T> elements, List<T> existing, Consumer<List<T>> setter) protected BaseParser.AttributeHandler<Element> protected BaseParser.ElementHandler<Element> protected BaseParser.ValueHandler<Element> protected <T> TdoParse(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler) protected <T> TdoParse(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler, boolean supportsExternalNamespaces) protected ElementdoParseDOMElement(String rootElementName, String namespace, List<Element> existing) protected Stringprotected <T> List<T> doParseValue(Supplier<T> definitionSupplier, BaseParser.ValueHandler<T> valueHandler) protected <T> TdoParseXml(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler, boolean supportsExternalNamespaces) protected voidprotected <T extends org.apache.camel.model.language.ExpressionDefinition>
BaseParser.ValueHandler<T> protected StringgetNextTag(String name, String name2) protected StringgetNextTag(String name, String name2, String name3) protected voidhandleOtherAttribute(Object definition, String name, String ns, String val) protected booleanhandleUnexpectedAttribute(String namespace, String name) protected booleanhandleUnexpectedElement(String namespace, String name) protected voidhandleUnexpectedText(String text) protected booleanprotected booleanignoreUnexpectedElement(String namespace, String name) protected booleanmatchNamespace(String ns, boolean optional) protected static booleanmatchNamespace(String ns, String namespace, Set<String> secondaryNamespaces, boolean optional) protected <T> BaseParser.AttributeHandler<T> protected <T> BaseParser.ElementHandler<T> protected <T> BaseParser.ValueHandler<T> protected static StringsanitizeUri(String uri)
-
Field Details
-
parser
-
namespace
-
secondaryNamespaces
-
resource
protected org.apache.camel.spi.Resource resource
-
-
Constructor Details
-
BaseParser
public BaseParser(org.apache.camel.spi.Resource resource) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
BaseParser
public BaseParser(org.apache.camel.spi.Resource resource, String namespace) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
BaseParser
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
- Throws:
IOExceptionXmlPullParserException
-
-
Method Details
-
addSecondaryNamespace
-
doParse
protected <T> T doParse(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
doParse
protected <T> T doParse(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler, boolean supportsExternalNamespaces) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
doParseXml
protected <T> T doParseXml(T definition, BaseParser.AttributeHandler<T> attributeHandler, BaseParser.ElementHandler<T> elementHandler, BaseParser.ValueHandler<T> valueHandler, boolean supportsExternalNamespaces) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
doParseValue
protected <T> List<T> doParseValue(Supplier<T> definitionSupplier, BaseParser.ValueHandler<T> valueHandler) throws IOException, XmlPullParserException - Throws:
IOExceptionXmlPullParserException
-
asClass
- Throws:
XmlPullParserException
-
asClassArray
- Throws:
XmlPullParserException
-
asByteArray
-
asStringList
-
asStringSet
-
doAdd
-
doAddValues
-
doParseText
- Throws:
IOExceptionXmlPullParserException
-
doParseDOMElement
protected Element doParseDOMElement(String rootElementName, String namespace, List<Element> existing) throws XmlPullParserException, IOException - Throws:
XmlPullParserExceptionIOException
-
doAddElement
-
handleUnexpectedAttribute
protected boolean handleUnexpectedAttribute(String namespace, String name) throws XmlPullParserException - Throws:
XmlPullParserException
-
handleUnexpectedElement
protected boolean handleUnexpectedElement(String namespace, String name) throws XmlPullParserException - Throws:
XmlPullParserException
-
handleUnexpectedText
- Throws:
XmlPullParserException
-
ignoreUnexpectedElement
protected boolean ignoreUnexpectedElement(String namespace, String name) throws XmlPullParserException - Throws:
XmlPullParserException
-
expectTag
- Throws:
XmlPullParserExceptionIOException
-
hasTag
- Throws:
XmlPullParserExceptionIOException
-
getNextTag
- Throws:
XmlPullParserExceptionIOException
-
getNextTag
protected String getNextTag(String name, String name2, String name3) throws XmlPullParserException, IOException - Throws:
XmlPullParserExceptionIOException
-
handleOtherAttribute
protected void handleOtherAttribute(Object definition, String name, String ns, String val) throws XmlPullParserException - Throws:
XmlPullParserException
-
noAttributeHandler
-
noElementHandler
-
noValueHandler
-
domAttributeHandler
-
domElementHandler
-
domValueHandler
-
expressionDefinitionValueHandler
protected <T extends org.apache.camel.model.language.ExpressionDefinition> BaseParser.ValueHandler<T> expressionDefinitionValueHandler() -
matchNamespace
-
matchNamespace
-
sanitizeUri
-