Class PlainTextParser
- All Implemented Interfaces:
PlainTextMetaProvider,RecordReadable
See POJO Categories.
Media types
Handles
Produces
Description
Essentially just converts plain text to POJOs via static
Also parses objects using a transform if the object class has an ObjectSwap<?,String> transform
defined on it.
Notes:
- This class is thread safe and reusable.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.juneau.marshall.parser.ReaderParser
ReaderParser.DefaultBuilderNested classes/interfaces inherited from class org.apache.juneau.marshall.parser.Parser
Parser.Null -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PlainTextParserDefault parser, all default settings.Fields inherited from class org.apache.juneau.marshall.parser.Parser
autoCloseStreams, consumes, debugOutputLines, listener, nulls, trimStrings, unbufferedFields inherited from class org.apache.juneau.marshall.MarshallingContextable
marshallingContextFields inherited from class org.apache.juneau.marshall.Context
CONTEXT_APPLY_FILTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a builder from this context object.static PlainTextParser.Buildercreate()Creates a new builder for this object.Create a session builder based on the properties defined on this context.Returns the language-specific metadata on the specified bean property.getPlainTextClassMeta(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.Returns a session to use for this context.booleanStreaming-quality signal queryable before opening a cursor.readRecords(Object input) Convenience delegator that opens aRecordReaderover the input using default session arguments (mirrorsParser.read(Object, Class)).Methods inherited from class org.apache.juneau.marshall.parser.ReaderParser
getStreamCharset, isReaderParser, propertiesMethods inherited from class org.apache.juneau.marshall.parser.Parser
canHandle, createParserBuilder, doRead, getDebugOutputLines, getListener, getMediaTypes, getNulls, getPrimaryMediaType, isAutoCloseStreams, isTrimStrings, isUnbuffered, read, read, read, read, read, read, readArgs, readIntoCollection, readIntoMap, readWithOuterMethods inherited from class org.apache.juneau.marshall.MarshallingContextable
getDurationFormat, getMarshallingContext, getPeriodFormatMethods inherited from class org.apache.juneau.marshall.Context
createBuilder, getAnnotationProvider, init, isDebug, toString
-
Field Details
-
DEFAULT
Default parser, all default settings.
-
-
Constructor Details
-
PlainTextParser
Constructor.- Parameters:
builder- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Returns:
- A new builder.
-
copy
Description 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.
-
createSession
Description 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 classReaderParser- Returns:
- A new session builder.
-
getPlainTextBeanPropertyMeta
Description copied from interface:PlainTextMetaProviderReturns the language-specific metadata on the specified bean property.- Specified by:
getPlainTextBeanPropertyMetain interfacePlainTextMetaProvider- Parameters:
bpm- The bean property to return the metadata on.- Returns:
- The metadata.
-
getPlainTextClassMeta
Description copied from interface:PlainTextMetaProviderReturns the language-specific metadata on the specified class.- Specified by:
getPlainTextClassMetain interfacePlainTextMetaProvider- Parameters:
cm- The class to return the metadata on.- Returns:
- The metadata.
-
getSession
Description 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 classReaderParser- Returns:
- A new session object.
-
readRecords
Convenience delegator that opens aRecordReaderover the input using default session arguments (mirrorsParser.read(Object, Class)).The real implementation lives on
PlainTextParserSession.readRecords(Object). Callers that need request-derived configuration (locale, timezone, schema, swaps) should callcreateSession()and invokePlainTextParserSession.readRecords(Object)on the built session instead.- Specified by:
readRecordsin interfaceRecordReadable- Parameters:
input- The input.- Returns:
- A new
RecordReadercursor. - Throws:
IOException- If a problem occurred opening the underlying input.
-
isRecordStreaming
Description copied from interface:RecordReadableStreaming-quality signal queryable before opening a cursor.- Specified by:
isRecordStreamingin interfaceRecordReadable- Returns:
true ifRecordReadable.readRecords(Object)returns an O(1)-memory streaming cursor;false for buffered (whole-value) formats backed byRecordAdapter.
-