Package org.apache.juneau.uon
Class UonParser
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.BeanContextable
org.apache.juneau.parser.Parser
org.apache.juneau.parser.ReaderParser
org.apache.juneau.uon.UonParser
- All Implemented Interfaces:
- AnnotationProvider,- HttpPartParser,- UonMetaProvider
- Direct Known Subclasses:
- OpenApiParser,- UonParser.Decoding,- UrlEncodingParser
Parses UON (a notation for URL-encoded query parameter values) text into POJO models.
 
Media types
 Handles 
Description
This parser uses a state machine, which makes it very fast and efficient.
Notes:
- This class is thread safe and reusable.
See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class.static classDefault parser, decoding.Nested classes/interfaces inherited from class org.apache.juneau.parser.ParserParser.NullNested classes/interfaces inherited from interface org.apache.juneau.httppart.HttpPartParserHttpPartParser.Creator, HttpPartParser.Void
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final UonParserReusable instance ofUonParser, all default settings.static final UonParserReusable instance ofUonParserwith decodeChars set to true.Fields inherited from class org.apache.juneau.ContextCONTEXT_APPLY_FILTERFields inherited from interface org.apache.juneau.AnnotationProviderDISABLE_ANNOTATION_CACHING
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncopy()Creates a builder from this context object.static UonParser.Buildercreate()Creates a new builder for this object.Create a session builder based on the properties defined on this context.<T> ClassMeta<T>getClassMeta(Class<T> c) Returns metadata about the specified class.<T> ClassMeta<T>getClassMeta(Type t, Type... args) Returns metadata about the specified class.Creates a new parser session.Returns a session to use for this context.Returns the language-specific metadata on the specified bean property.getUonClassMeta(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.protected final booleanDecode"%xx" sequences enabledprotected final booleanValidate end enabled.<T> Tparse(HttpPartType partType, HttpPartSchema schema, String in, Class<T> toType) Converts the specified input to the specified class type.<T> Tparse(HttpPartType partType, HttpPartSchema schema, String in, Type toType, Type... toTypeArgs) Converts the specified input to the specified class type.<T> Tparse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> toType) Converts the specified input to the specified class type.protected JsonMapReturns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.parser.ReaderParsergetFileCharset, getStreamCharset, isReaderParserMethods inherited from class org.apache.juneau.parser.ParsercanHandle, createParserBuilder, doParse, getDebugOutputLines, getListener, getMediaTypes, getPrimaryMediaType, isAutoCloseStreams, isStrict, isTrimStrings, isUnbuffered, parse, parse, parse, parse, parse, parse, parseArgs, parseIntoCollection, parseIntoMapMethods inherited from class org.apache.juneau.BeanContextablegetBeanContextMethods inherited from class org.apache.juneau.ContextcreateBuilder, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.AnnotationProviderfirstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation
- 
Field Details
- 
Constructor Details- 
UonParserConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Returns:
- A new builder.
 
- 
copyDescription copied from class:ContextCreates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations. 
- 
createSessionDescription copied from class:ContextCreate a session builder based on the properties defined on this context.Use this method for creating sessions where you want to override basic settings. Otherwise, use Context.getSession()directly.- Overrides:
- createSessionin class- ReaderParser
- Returns:
- A new session builder.
 
- 
getSessionDescription copied from class:ContextReturns a session to use for this context.Note that subclasses may opt to return a reusable non-modifiable session. - Overrides:
- getSessionin class- ReaderParser
- Returns:
- A new session object.
 
- 
getPartSessionDescription copied from interface:HttpPartParserCreates a new parser session.- Specified by:
- getPartSessionin interface- HttpPartParser
- Returns:
- A new parser session.
 
- 
parsepublic <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> toType) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
- T- The POJO type to transform the input into.
- Parameters:
- partType- The part type being parsed.
- schema- Schema information about the part.
 May be- null .
 Not all part parsers use the schema information.
- in- The input being parsed.
- toType- The POJO type to transform the input into.
- Returns:
- The parsed value.
- Throws:
- ParseException- Malformed input encountered.
- SchemaValidationException- If the input or resulting HTTP part object fails schema validation.
 
- 
parsepublic <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Class<T> toType) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
- T- The POJO type to transform the input into.
- Parameters:
- partType- The part type being parsed.
- schema- Schema information about the part.
 May be- null .
 Not all part parsers use the schema information.
- in- The input being parsed.
- toType- The POJO type to transform the input into.
- Returns:
- The parsed value.
- Throws:
- ParseException- Malformed input encountered.
- SchemaValidationException- If the input or resulting HTTP part object fails schema validation.
 
- 
parsepublic <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, Type toType, Type... toTypeArgs) throws ParseException, SchemaValidationException Converts the specified input to the specified class type.- Type Parameters:
- T- The POJO type to transform the input into.
- Parameters:
- partType- The part type being parsed.
- schema- Schema information about the part.
 May be- null .
 Not all part parsers use the schema information.
- in- The input being parsed.
- toType- The POJO type to transform the input into.
- toTypeArgs- The generic type arguments of the POJO type to transform the input into.
- Returns:
- The parsed value.
- Throws:
- ParseException- Malformed input encountered.
- SchemaValidationException- If the input or resulting HTTP part object fails schema validation.
 
- 
getUonClassMetaDescription copied from interface:UonMetaProviderReturns the language-specific metadata on the specified class.- Specified by:
- getUonClassMetain interface- UonMetaProvider
- Parameters:
- cm- The class to return the metadata on.
- Returns:
- The metadata.
 
- 
getUonBeanPropertyMetaDescription copied from interface:UonMetaProviderReturns the language-specific metadata on the specified bean property.- Specified by:
- getUonBeanPropertyMetain interface- UonMetaProvider
- Parameters:
- bpm- The bean property to return the metadata on.
- Returns:
- The metadata.
 
- 
isDecodingDecode"%xx" sequences enabled- Returns:
- true if URI encoded characters should be decoded,- false if they've already been decoded before being passed to this parser.
- See Also:
 
- 
isValidateEndValidate end enabled.- Returns:
- true if after parsing a POJO from the input, verifies that the remaining input in the stream consists of only comments or whitespace.
- See Also:
 
- 
getClassMetaDescription copied from interface:HttpPartParserReturns metadata about the specified class.- Specified by:
- getClassMetain interface- HttpPartParser
- Type Parameters:
- T- The class type.
- Parameters:
- c- The class type.
- Returns:
- Metadata about the specified class.
 
- 
getClassMetaDescription copied from interface:HttpPartParserReturns metadata about the specified class.- Specified by:
- getClassMetain interface- HttpPartParser
- Type Parameters:
- T- The class type.
- Parameters:
- t- The class type.
- args- The class type args.
- Returns:
- Metadata about the specified class.
 
- 
propertiesDescription copied from class:ContextReturns the properties on this bean as a map for debugging.- Overrides:
- propertiesin class- ReaderParser
- Returns:
- The properties on this bean as a map for debugging.
 
 
-