Package org.apache.camel.xml.in
Class BaseParser
- java.lang.Object
-
- org.apache.camel.xml.in.BaseParser
-
- Direct Known Subclasses:
ModelParser
public class BaseParser extends Object
-
-
Constructor Summary
Constructors Constructor Description BaseParser(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]asByteArray(String val)protected Class<?>asClass(String val)protected Class<?>[]asClassArray(String val)protected List<String>asStringList(String val)protected Set<String>asStringSet(String val)protected <T> voiddoAdd(T element, List<T> existing, Consumer<List<T>> setter)protected <T> voiddoAdd(T element, T[] existing, Consumer<T[]> setter)protected <T> TdoParse(T definition, org.apache.camel.xml.in.BaseParser.AttributeHandler<T> attributeHandler, org.apache.camel.xml.in.BaseParser.ElementHandler<T> elementHandler, org.apache.camel.xml.in.BaseParser.ValueHandler<T> valueHandler)protected StringdoParseText()protected voidexpectTag(String name)protected <T extends org.apache.camel.model.language.ExpressionDefinition>
org.apache.camel.xml.in.BaseParser.ValueHandler<T>expressionDefinitionValueHandler()protected StringgetNextTag(String name, String name2)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 booleanhasTag(String name)protected <T> org.apache.camel.xml.in.BaseParser.AttributeHandler<T>noAttributeHandler()protected <T> org.apache.camel.xml.in.BaseParser.ElementHandler<T>noElementHandler()protected <T> org.apache.camel.xml.in.BaseParser.ValueHandler<T>noValueHandler()
-
-
-
Constructor Detail
-
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
public BaseParser(InputStream input) throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
public BaseParser(Reader reader) throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
public BaseParser(InputStream input, String namespace) throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
BaseParser
public BaseParser(Reader reader, String namespace) throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
-
Method Detail
-
doParse
protected <T> T doParse(T definition, org.apache.camel.xml.in.BaseParser.AttributeHandler<T> attributeHandler, org.apache.camel.xml.in.BaseParser.ElementHandler<T> elementHandler, org.apache.camel.xml.in.BaseParser.ValueHandler<T> valueHandler) throws IOException, XmlPullParserException- Throws:
IOExceptionXmlPullParserException
-
asClass
protected Class<?> asClass(String val) throws XmlPullParserException
- Throws:
XmlPullParserException
-
asClassArray
protected Class<?>[] asClassArray(String val) throws XmlPullParserException
- Throws:
XmlPullParserException
-
asByteArray
protected byte[] asByteArray(String val)
-
doAdd
protected <T> void doAdd(T element, T[] existing, Consumer<T[]> setter)
-
doParseText
protected String doParseText() throws IOException, XmlPullParserException
- Throws:
IOExceptionXmlPullParserException
-
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
protected void handleUnexpectedText(String text) throws XmlPullParserException
- Throws:
XmlPullParserException
-
expectTag
protected void expectTag(String name) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
hasTag
protected boolean hasTag(String name) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
getNextTag
protected String getNextTag(String name, String name2) throws XmlPullParserException, IOException
- Throws:
XmlPullParserExceptionIOException
-
handleOtherAttribute
protected void handleOtherAttribute(Object definition, String name, String ns, String val) throws XmlPullParserException
- Throws:
XmlPullParserException
-
noAttributeHandler
protected <T> org.apache.camel.xml.in.BaseParser.AttributeHandler<T> noAttributeHandler()
-
noElementHandler
protected <T> org.apache.camel.xml.in.BaseParser.ElementHandler<T> noElementHandler()
-
noValueHandler
protected <T> org.apache.camel.xml.in.BaseParser.ValueHandler<T> noValueHandler()
-
expressionDefinitionValueHandler
protected <T extends org.apache.camel.model.language.ExpressionDefinition> org.apache.camel.xml.in.BaseParser.ValueHandler<T> expressionDefinitionValueHandler()
-
-