Package com.amazon.ion.impl
Class _Private_IonReaderBuilder
- java.lang.Object
-
- com.amazon.ion.system.IonReaderBuilder
-
- com.amazon.ion.impl._Private_IonReaderBuilder
-
- Direct Known Subclasses:
_Private_IonReaderBuilder.Mutable
public class _Private_IonReaderBuilder extends IonReaderBuilder
IonReaderBuilder
extension for internal use only.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
_Private_IonReaderBuilder.Mutable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IonReader
build(byte[] ionData, int offset, int length)
Based on the builder's configuration properties, creates a new IonReader instance over the given block of Ion data, detecting whether it's text or binary data.IonReader
build(IonValue value)
IonReader
build(java.io.InputStream ionData)
Based on the builder's configuration properties, creates a new IonReader instance over the given stream of Ion data, detecting whether it's text or binary data.IonReader
build(java.io.Reader ionText)
Based on the builder's configuration properties, creates a newIonReader
instance over Ion text data.IonTextReader
build(java.lang.String ionText)
Based on the builder's configuration properties, creates an newIonReader
instance over Ion text data.void
setLstFactory(_Private_LocalSymbolTableFactory factory)
IonReaderBuilder
withLstFactory(_Private_LocalSymbolTableFactory factory)
Declares the_Private_LocalSymbolTableFactory
to use when constructing applicable readers.-
Methods inherited from class com.amazon.ion.system.IonReaderBuilder
build, copy, getBufferConfiguration, getCatalog, immutable, isAnnotationIteratorReuseEnabled, isIncrementalReadingEnabled, mutable, mutationCheck, setAnnotationIteratorReuseDisabled, setAnnotationIteratorReuseEnabled, setBufferConfiguration, setCatalog, setIncrementalReadingDisabled, setIncrementalReadingEnabled, standard, validateCatalog, withAnnotationIteratorReuseEnabled, withBufferConfiguration, withCatalog, withIncrementalReadingEnabled
-
-
-
-
Method Detail
-
withLstFactory
public IonReaderBuilder withLstFactory(_Private_LocalSymbolTableFactory factory)
Declares the_Private_LocalSymbolTableFactory
to use when constructing applicable readers.- Parameters:
factory
- the factory to use, orLocalSymbolTable.DEFAULT_LST_FACTORY
if null.- Returns:
- this builder instance, if mutable; otherwise a mutable copy of this builder.
- See Also:
setLstFactory(_Private_LocalSymbolTableFactory)
-
setLstFactory
public void setLstFactory(_Private_LocalSymbolTableFactory factory)
-
build
public IonReader build(byte[] ionData, int offset, int length)
Description copied from class:IonReaderBuilder
Based on the builder's configuration properties, creates a new IonReader instance over the given block of Ion data, detecting whether it's text or binary data.This method will auto-detect and uncompress GZIPped Ion data.
- Specified by:
build
in classIonReaderBuilder
- Parameters:
ionData
- the source of the Ion data, which is used only within the range of bytes starting atoffset
forlen
bytes. The data in that range may be either Ion binary data or UTF-8 Ion text. The reader retains a reference to the array, so its data must not be modified while the reader is active. Must not be null.offset
- must be non-negative and less thanionData.length
.length
- must be non-negative andoffset+length
must not exceedionData.length
.- See Also:
IonSystem.newReader(byte[], int, int)
-
build
public IonReader build(java.io.InputStream ionData)
Description copied from class:IonReaderBuilder
Based on the builder's configuration properties, creates a new IonReader instance over the given stream of Ion data, detecting whether it's text or binary data.This method will auto-detect and uncompress GZIPped Ion data.
Because this library performs its own buffering, it's recommended that users avoid adding additional buffering to the given stream.
- Specified by:
build
in classIonReaderBuilder
- Parameters:
ionData
- the source of the Ion data, which may be either Ion binary data or UTF-8 Ion text. Must not be null.- Returns:
- a new reader instance.
Callers must call
Closeable.close()
when finished with it. - See Also:
IonSystem.newReader(InputStream)
-
build
public IonReader build(java.io.Reader ionText)
Description copied from class:IonReaderBuilder
Based on the builder's configuration properties, creates a newIonReader
instance over Ion text data.Applications should generally use
IonReaderBuilder.build(InputStream)
whenever possible, since this library has much faster Unicode decoding than the Java IO framework.Because this library performs its own buffering, it's recommended that you avoid adding additional buffering to the given stream.
- Specified by:
build
in classIonReaderBuilder
- Parameters:
ionText
- the source of the Ion text data. Must not be null.- See Also:
IonSystem.newReader(Reader)
-
build
public IonReader build(IonValue value)
Description copied from class:IonReaderBuilder
Based on the builder's configuration properties, creates a newIonReader
instance over anIonValue
data model. Typically this is used to iterate over a collection, such as anIonStruct
. The given value and its children, if any, must not be modified until after the IonReader constructed by this method is closed. Violating this constraint results in undefined behavior.- Specified by:
build
in classIonReaderBuilder
- Parameters:
value
- must not be null.- See Also:
IonSystem.newReader(IonValue)
-
build
public IonTextReader build(java.lang.String ionText)
Description copied from class:IonReaderBuilder
Based on the builder's configuration properties, creates an newIonReader
instance over Ion text data.- Specified by:
build
in classIonReaderBuilder
- Parameters:
ionText
- the source of the Ion text data. Must not be null.- See Also:
IonSystem.newReader(String)
-
-