Package org.apache.juneau.urlencoding
Class UrlEncodingParserSession
java.lang.Object
org.apache.juneau.ContextSession
org.apache.juneau.BeanSession
org.apache.juneau.parser.ParserSession
org.apache.juneau.parser.ReaderParserSession
org.apache.juneau.uon.UonParserSession
org.apache.juneau.urlencoding.UrlEncodingParserSession
- All Implemented Interfaces:
HttpPartParserSession
Session object that lives for the duration of a single use of
UrlEncodingParser
.
Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(UrlEncodingParser ctx) Creates a new builder for this object.protected <T> T
doParse
(ParserPipe pipe, ClassMeta<T> type) Workhorse method.protected <K,
V> Map<K, V> doParseIntoMap
(ParserPipe pipe, Map<K, V> m, Type keyType, Type valueType) Implementation method.protected UrlEncodingClassMeta
getUrlEncodingClassMeta
(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.protected final boolean
Parser bean property collections/arrays as separate key/value pairs.final boolean
Returnstrue if the specified bean property should be expanded as multiple key-value pairs.Methods inherited from class org.apache.juneau.uon.UonParserSession
create, doParseIntoCollection, getUonReader, isDecoding, isValidateEnd, parse, parseAnything, parseAttr, parseAttrName, parseString, properties
Methods inherited from class org.apache.juneau.parser.ReaderParserSession
create, createPipe, getFileCharset, getStreamCharset, isReaderParser
Methods inherited from class org.apache.juneau.parser.ParserSession
cast, convertAttrToType, create, getClassMeta, getDebugOutputLines, getInputAsString, getJavaMethod, getLastLocation, getListener, getListener, getListenerClass, getOuter, getPosition, getSchema, getStringBuilder, isAutoCloseStreams, isStrict, isTrimStrings, isUnbuffered, mark, onBeanSetterException, onUnknownProperty, parse, parse, parse, parse, parse, parse, parseArgs, parseIntoCollection, parseIntoMap, returnStringBuilder, setCurrentClass, setCurrentProperty, setName, setParent, setPipe, trim, trim, unmark, unswap
Methods inherited from class org.apache.juneau.BeanSession
_class, addWarning, convertToMemberType, convertToMemberType, convertToType, convertToType, convertToType, create, getArgsClassMeta, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionary, getBeanFieldVisibility, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBeanTypePropertyName, getClassMeta, getClassMeta, getClassMetaForObject, getClassMetaForObject, getLocale, getMediaType, getNamePropertyName, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPropertyNamer, getSwaps, getTimeZone, getTimeZoneId, isBean, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFindFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnoreMissingSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, newBean, newBean, newBeanMap, newBeanMap, newGenericMap, object, string, toArray, toBeanMap, toBeanMap, toBeanMap
Methods inherited from class org.apache.juneau.ContextSession
checkForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toString
-
Constructor Details
-
UrlEncodingParserSession
Constructor.- Parameters:
builder
- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Parameters:
ctx
- The context creating this session.- Returns:
- A new builder.
-
shouldUseExpandedParams
Returnstrue if the specified bean property should be expanded as multiple key-value pairs.- Parameters:
pMeta
- The metadata on the bean property.- Returns:
true if the specified bean property should be expanded as multiple key-value pairs.
-
doParse
protected <T> T doParse(ParserPipe pipe, ClassMeta<T> type) throws IOException, ParseException, ExecutableException Description copied from class:ParserSession
Workhorse method.Subclasses are expected to implement this method or
Parser.doParse(ParserSession,ParserPipe,ClassMeta)
.The default implementation of this method simply calls
Parser.doParse(ParserSession,ParserPipe,ClassMeta)
.- Overrides:
doParse
in classUonParserSession
- Type Parameters:
T
- The class type of the object to create.- Parameters:
pipe
- Where to get the input from.type
- The class type of the object to create. Ifnull orObject.
, object type is based on what's being parsed. For example, when parsing JSON text, it may return aclass String ,Number ,JsonMap , etc...- Returns:
- The parsed object.
- Throws:
IOException
- Thrown by underlying stream.ParseException
- Malformed input encountered.ExecutableException
- Exception occurred on invoked constructor/method/field.
-
doParseIntoMap
protected <K,V> Map<K,V> doParseIntoMap(ParserPipe pipe, Map<K, V> m, Type keyType, Type valueType) throws ExceptionDescription copied from class:ParserSession
Implementation method.Default implementation throws an
UnsupportedOperationException
.- Overrides:
doParseIntoMap
in classUonParserSession
- Type Parameters:
K
- The key type.V
- The value type.- Parameters:
pipe
- The parser input.m
- The map being loaded.keyType
- The class type of the keys, ornull to default toString.
.class valueType
- The class type of the values, ornull to default to whatever is being parsed.- Returns:
- The same map that was passed in to allow this method to be chained.
- Throws:
Exception
- If thrown from underlying stream, or if the input contains a syntax error or is malformed.
-
isExpandedParams
Parser bean property collections/arrays as separate key/value pairs.- Returns:
false if serializing the array[1,2,3] results in?key=$a(1,2,3) .true if serializing the same array results in?key=1&key=2&key=3 .- See Also:
-
getUrlEncodingClassMeta
Returns the language-specific metadata on the specified class.- Parameters:
cm
- The class to return the metadata on.- Returns:
- The metadata.
-