Package org.apache.juneau.json
Class JsonParserSession
java.lang.Object
org.apache.juneau.ContextSession
org.apache.juneau.BeanSession
org.apache.juneau.parser.ParserSession
org.apache.juneau.parser.ReaderParserSession
org.apache.juneau.json.JsonParserSession
Session object that lives for the duration of a single use of 
JsonParser.
 Notes:
- This class is not thread safe and is typically discarded after one use.
See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConstructor.
- 
Method SummaryModifier and TypeMethodDescriptionstatic JsonParserSession.Buildercreate(JsonParser ctx) Creates a new builder for this object.protected <T> TdoParse(ParserPipe pipe, ClassMeta<T> type) Workhorse method.protected <E> Collection<E>doParseIntoCollection(ParserPipe pipe, Collection<E> c, Type elementType) Implementation method.protected <K,V> Map<K, V> doParseIntoMap(ParserPipe pipe, Map<K, V> m, Type keyType, Type valueType) Implementation method.protected JsonClassMetagetJsonClassMeta(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.protected booleanisCommentOrWhitespace(int cp) Returnstrue if the specified character is whitespace or '/'.protected booleanValidate end.protected booleanisWhitespace(int cp) Returnstrue if the specified character is whitespace.Methods inherited from class org.apache.juneau.parser.ReaderParserSessioncreate, createPipe, getFileCharset, getStreamCharset, isReaderParser, propertiesMethods inherited from class org.apache.juneau.parser.ParserSessioncast, 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, unswapMethods 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, toBeanMapMethods inherited from class org.apache.juneau.ContextSessioncheckForWarnings, getContext, getSessionProperties, getWarnings, isDebug, toString
- 
Constructor Details- 
JsonParserSessionConstructor.- Parameters:
- builder- The builder for this object.
 
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Parameters:
- ctx- The context creating this session.
- Returns:
- A new builder.
 
- 
isWhitespaceReturnstrue if the specified character is whitespace.The definition of whitespace is different for strict vs lax mode. Strict mode only interprets 0x20 (space), 0x09 (tab), 0x0A (line feed) and 0x0D (carriage return) as whitespace. Lax mode uses Character.isWhitespace(int)to make the determination.- Parameters:
- cp- The codepoint.
- Returns:
- true if the specified character is whitespace.
 
- 
isCommentOrWhitespaceReturnstrue if the specified character is whitespace or '/'.- Parameters:
- cp- The codepoint.
- Returns:
- true if the specified character is whitespace or '/'.
 
- 
doParseprotected <T> T doParse(ParserPipe pipe, ClassMeta<T> type) throws IOException, ParseException, ExecutableException Description copied from class:ParserSessionWorkhorse 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:
- doParsein class- ParserSession
- 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. If- null or- Object., object type is based on what's being parsed. For example, when parsing JSON text, it may return a- class - 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.
 
- 
doParseIntoMapprotected <K,V> Map<K,V> doParseIntoMap(ParserPipe pipe, Map<K, V> m, Type keyType, Type valueType) throws IOException, ParseException, ExecutableExceptionDescription copied from class:ParserSessionImplementation method.Default implementation throws an UnsupportedOperationException.- Overrides:
- doParseIntoMapin class- ParserSession
- 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, or- null to default to- String..- class 
- valueType- The class type of the values, or- null to default to whatever is being parsed.
- Returns:
- The same map that was passed in to allow this method to be chained.
- Throws:
- IOException
- ParseException
- ExecutableException
 
- 
doParseIntoCollectionprotected <E> Collection<E> doParseIntoCollection(ParserPipe pipe, Collection<E> c, Type elementType) throws IOException, ParseException, ExecutableException Description copied from class:ParserSessionImplementation method.Default implementation throws an UnsupportedOperationException.- Overrides:
- doParseIntoCollectionin class- ParserSession
- Type Parameters:
- E- The element type.
- Parameters:
- pipe- The parser input.
- c- The collection being loaded.
- elementType- The class type of the elements, or- null to default to whatever is being parsed.
- Returns:
- The same collection that was passed in to allow this method to be chained.
- Throws:
- IOException
- ParseException
- ExecutableException
 
- 
isValidateEndValidate end.- 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:
 
- 
getJsonClassMetaReturns the language-specific metadata on the specified class.- Parameters:
- cm- The class to return the metadata on.
- Returns:
- The metadata.
 
 
-