public class TextWire extends AbstractWire implements Wire
WireIn.HeaderType
MarshallableOut.Padding
Modifier and Type | Field and Description |
---|---|
static net.openhft.chronicle.bytes.BytesStore |
BINARY |
protected long |
lineStart |
static net.openhft.chronicle.bytes.BytesStore |
TYPE |
static @NotNull net.openhft.chronicle.bytes.Bytes<byte[]> |
TYPE_STR |
protected net.openhft.chronicle.wire.TextWire.TextValueIn |
valueIn |
ASSERTIONS, bytes, classLookup, parent, use8bit
MARSHALLABLE_IN_INTERN_SIZE
Constructor and Description |
---|
TextWire(@NotNull net.openhft.chronicle.bytes.Bytes bytes) |
TextWire(@NotNull net.openhft.chronicle.bytes.Bytes bytes,
boolean use8bit) |
Modifier and Type | Method and Description |
---|---|
DocumentContext |
acquireWritingDocument(boolean metaData)
Start or reuse an existing a DocumentContext, optionally call close() when done.
|
@NotNull WireOut |
addPadding(int paddingToAdd) |
boolean |
addTimeStamps() |
TextWire |
addTimeStamps(boolean addTimeStamps) |
void |
append(@NotNull CharSequence cs) |
void |
append(@NotNull CharSequence cs,
int offset,
int length) |
static String |
asText(@NotNull Wire wire) |
@NotNull net.openhft.chronicle.bytes.Bytes<?> |
bytes()
Returns the underlying
Bytes stored by the wire. |
net.openhft.chronicle.core.pool.ClassLookup |
classLookup()
Returns the current
ClassLookup implementation being used for class lookup. |
void |
classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
Sets the
ClassLookup implementation to be used for class lookup. |
void |
clear()
Resets the state of the underlying
Bytes stored by the wire. |
protected void |
consumeDocumentStart() |
void |
consumePadding() |
void |
consumePadding(int commas) |
void |
consumeWhiteSpace() |
void |
copyTo(@NotNull WireOut wire) |
protected @NotNull net.openhft.chronicle.wire.TextWire.TextValueIn |
createValueIn() |
protected @NotNull net.openhft.chronicle.wire.TextWire.TextValueOut |
createValueOut() |
@NotNull WireOut |
dropDefault(boolean dropDefault) |
protected void |
escape0(@NotNull CharSequence s,
@NotNull net.openhft.chronicle.wire.Quotes quotes) |
static @NotNull TextWire |
from(@NotNull String text) |
static @NotNull TextWire |
fromFile(String name) |
protected @NotNull net.openhft.chronicle.bytes.StopCharsTester |
getEscapingEndEventName() |
protected @NotNull net.openhft.chronicle.bytes.StopCharTester |
getEscapingEndOfText() |
protected @Nullable net.openhft.chronicle.bytes.StopCharTester |
getEscapingQuotes() |
protected @NotNull net.openhft.chronicle.bytes.StopCharsTester |
getStrictEscapingEndOfText() |
@NotNull ValueIn |
getValueIn()
Obtain the value in (for internal use)
|
@NotNull ValueOut |
getValueOut()
Obtain the value out
|
protected void |
initReadContext() |
static <T> T |
load(String filename)
Loads an Object from a file
|
@NotNull VanillaMethodReaderBuilder |
methodReaderBuilder() |
<T> T |
methodWriter(@NotNull Class<T> tClass,
Class... additional)
Proxy an interface so each message called is written to a file for replay.
|
<T> @NotNull net.openhft.chronicle.bytes.MethodWriterBuilder<T> |
methodWriterBuilder(@NotNull Class<T> tClass) |
protected @NotNull net.openhft.chronicle.wire.Quotes |
needsQuotes(@NotNull CharSequence s) |
@NotNull net.openhft.chronicle.core.values.BooleanValue |
newBooleanReference()
Creates and returns a new
BooleanValue . |
@NotNull net.openhft.chronicle.core.values.IntArrayValues |
newIntArrayReference()
Creates and returns a new
IntArrayValues . |
@NotNull net.openhft.chronicle.core.values.IntValue |
newIntReference()
Creates and returns a new
IntValue . |
@NotNull net.openhft.chronicle.core.values.LongArrayValues |
newLongArrayReference()
Creates and returns a new
LongArrayValues . |
@NotNull net.openhft.chronicle.core.values.LongValue |
newLongReference()
Creates and returns a new
LongValue . |
void |
parseUntil(@NotNull StringBuilder sb,
@NotNull net.openhft.chronicle.bytes.StopCharsTester testers) |
void |
parseUntil(@NotNull StringBuilder sb,
@NotNull net.openhft.chronicle.bytes.StopCharTester testers) |
void |
parseWord(@NotNull StringBuilder sb) |
protected boolean |
peekStringIgnoreCase(@NotNull String source)
returns true if the next string is
str |
@NotNull ValueIn |
read()
Read the field if present, or empty string if not present.
|
@NotNull ValueIn |
read(@NotNull StringBuilder name)
Read the field if present, or empty string if not present.
|
@NotNull ValueIn |
read(@NotNull WireKey key)
Read the field if present which must match the WireKey.
|
protected ValueIn |
read2(CharSequence keyName,
int keyCode,
Object defaultValue,
@NotNull net.openhft.chronicle.wire.ValueInState curr,
@NotNull StringBuilder sb,
@NotNull CharSequence name) |
protected int |
readCode() |
@NotNull Wire |
readComment(@NotNull StringBuilder s) |
<K> K |
readEvent(@NotNull Class<K> expectedClass)
Read a field which might be an object of any type.
|
long |
readEventNumber() |
protected @NotNull StringBuilder |
readField(@NotNull StringBuilder sb) |
@NotNull DocumentContext |
readingDocument()
equivalent to
WireIn.readDocument(net.openhft.chronicle.wire.ReadMarshallable,
net.openhft.chronicle.wire.ReadMarshallable) but with out the use of a lambda expression |
@NotNull DocumentContext |
readingDocument(long readLocation) |
@NotNull String |
readingPeekYaml() |
@Nullable Object |
readObject() |
boolean |
strict() |
TextWire |
strict(boolean strict) |
String |
toString() |
static <ACS extends Appendable & CharSequence> |
unescape(ACS sb) |
@NotNull TextWire |
useBinaryDocuments() |
@NotNull TextWire |
useTextDocuments() |
@NotNull ValueOut |
write()
Write an empty filed marker
|
@NotNull ValueOut |
write(@NotNull CharSequence name) |
@NotNull ValueOut |
write(@NotNull WireKey key)
Write a key for wires that support fields.
|
@NotNull Wire |
writeComment(@NotNull CharSequence s) |
void |
writeEndEvent() |
ValueOut |
writeEvent(Class expectedType,
Object eventKey) |
void |
writeObject(Object o) |
void |
writeStartEvent()
Start an event object, mostly for internal use.
|
@NotNull DocumentContext |
writingDocument(boolean metaData)
This will increment the headerNumber as appropriate if successful
|
bytesComment, endUse, enterHeader, forceNotInsideHeader, headerNumber, headerNumber, headNumberCheck, isInsideHeader, notCompleteIsNotPresent, notCompleteIsNotPresent, objectInput, objectOutput, parent, parent, pauser, pauser, readAndSetLength, readDataHeader, readFirstHeader, readFirstHeader, readMetaDataHeader, startUse, updateFirstHeader, updateHeader, usePadding, usePadding, writeEndOfWire, writeFirstHeader
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
headerNumber
asText, endEvent, hasMore, hintReadInputOrder, isEmpty, isEndEvent, isNotEmptyAfterPadding, objectInput, rawReadData, read, readAlignTo, readAllAsMap, readAndSetLength, readDataHeader, readDataHeader, readDocument, readDocument, readEventName, readFirstHeader, readFirstHeader, readMetaDataHeader, startEvent
methodReader, peekDocument, readBytes, readBytes, readDocument, readMap, readText, readText
enterHeader, objectOutput, padToCacheAlign, updateFirstHeader, updateHeader, writeAlignTo, writeAllAsMap, writeDocument, writeEndOfWire, writeEventId, writeEventId, writeEventName, writeEventName, writeFirstHeader, writeNotCompleteDocument, writingDocument
bytesComment, endUse, headerNumber, newTwoLongReference, notCompleteIsNotPresent, notCompleteIsNotPresent, parent, parent, pauser, pauser, startUse, usePadding, usePadding
methodWriter, padToCacheAlignMode, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeText
public static final net.openhft.chronicle.bytes.BytesStore TYPE
public static final net.openhft.chronicle.bytes.BytesStore BINARY
@NotNull public static final @NotNull net.openhft.chronicle.bytes.Bytes<byte[]> TYPE_STR
protected final net.openhft.chronicle.wire.TextWire.TextValueIn valueIn
protected long lineStart
public TextWire(@NotNull @NotNull net.openhft.chronicle.bytes.Bytes bytes, boolean use8bit)
public TextWire(@NotNull @NotNull net.openhft.chronicle.bytes.Bytes bytes)
@NotNull public static @NotNull TextWire fromFile(String name) throws IOException
fromFile
in interface Wire
IOException
public static <ACS extends Appendable & CharSequence> void unescape(@NotNull ACS sb)
public static <T> T load(String filename) throws IOException
T
- the type of the object to loadfilename
- the file-path containing the objectIOException
- if the file can not be found or readpublic boolean strict()
public TextWire strict(boolean strict)
public boolean addTimeStamps()
public TextWire addTimeStamps(boolean addTimeStamps)
@NotNull public <T> T methodWriter(@NotNull @NotNull Class<T> tClass, Class... additional)
MarshallableOut
methodWriter
in interface MarshallableOut
tClass
- primary interfaceadditional
- any additional interfaces@NotNull public <T> @NotNull net.openhft.chronicle.bytes.MethodWriterBuilder<T> methodWriterBuilder(@NotNull @NotNull Class<T> tClass)
methodWriterBuilder
in interface MarshallableOut
@NotNull public @NotNull VanillaMethodReaderBuilder methodReaderBuilder()
methodReaderBuilder
in interface MarshallableIn
public void classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
WireCommon
ClassLookup
implementation to be used for class lookup.classLookup
in interface WireCommon
classLookup
in class AbstractWire
classLookup
- implementation to be used for class lookup.public net.openhft.chronicle.core.pool.ClassLookup classLookup()
WireCommon
ClassLookup
implementation being used for class lookup.classLookup
in interface WireCommon
classLookup
in class AbstractWire
ClassLookup
implementation being used for class lookup@NotNull public @NotNull DocumentContext writingDocument(boolean metaData)
WireOut
writingDocument
in interface DocumentWritten
writingDocument
in interface MarshallableOut
writingDocument
in interface WireOut
metaData
- if true
the document context will be used for writing meta data,
otherwise datapublic DocumentContext acquireWritingDocument(boolean metaData)
MarshallableOut
acquireWritingDocument
in interface DocumentWritten
acquireWritingDocument
in interface MarshallableOut
acquireWritingDocument
in interface WireOut
@NotNull public @NotNull DocumentContext readingDocument()
WireIn
WireIn.readDocument(net.openhft.chronicle.wire.ReadMarshallable,
net.openhft.chronicle.wire.ReadMarshallable)
but with out the use of a lambda expressionreadingDocument
in interface MarshallableIn
readingDocument
in interface WireIn
protected void initReadContext()
@NotNull public @NotNull TextWire useBinaryDocuments()
@NotNull public @NotNull TextWire useTextDocuments()
@NotNull public @NotNull DocumentContext readingDocument(long readLocation)
readingDocument
in interface WireIn
@NotNull protected @NotNull net.openhft.chronicle.wire.TextWire.TextValueOut createValueOut()
@NotNull protected @NotNull net.openhft.chronicle.wire.TextWire.TextValueIn createValueIn()
public long readEventNumber()
readEventNumber
in interface WireIn
readEventNumber
in class AbstractWire
@NotNull public @NotNull ValueIn read()
WireIn
@NotNull protected @NotNull StringBuilder readField(@NotNull @NotNull StringBuilder sb)
@Nullable public <K> K readEvent(@NotNull @NotNull Class<K> expectedClass)
WireIn
@NotNull protected @NotNull net.openhft.chronicle.bytes.StopCharTester getEscapingEndOfText()
@NotNull protected @NotNull net.openhft.chronicle.bytes.StopCharsTester getStrictEscapingEndOfText()
@NotNull protected @NotNull net.openhft.chronicle.bytes.StopCharsTester getEscapingEndEventName()
@Nullable protected @Nullable net.openhft.chronicle.bytes.StopCharTester getEscapingQuotes()
public void consumePadding()
consumePadding
in interface WireIn
@NotNull public @NotNull String readingPeekYaml()
readingPeekYaml
in interface WireIn
public void consumePadding(int commas)
protected void consumeDocumentStart()
protected boolean peekStringIgnoreCase(@NotNull @NotNull String source)
str
source
- stringprotected int readCode()
@NotNull public @NotNull ValueIn read(@NotNull @NotNull WireKey key)
WireIn
protected ValueIn read2(CharSequence keyName, int keyCode, Object defaultValue, @NotNull @NotNull net.openhft.chronicle.wire.ValueInState curr, @NotNull @NotNull StringBuilder sb, @NotNull @NotNull CharSequence name)
@NotNull public @NotNull ValueIn read(@NotNull @NotNull StringBuilder name)
WireIn
@NotNull public @NotNull ValueIn getValueIn()
WireIn
getValueIn
in interface WireIn
@NotNull public @NotNull Wire readComment(@NotNull @NotNull StringBuilder s)
readComment
in interface WireIn
public void consumeWhiteSpace()
public void clear()
WireCommon
Bytes
stored by the wire.clear
in interface WireCommon
clear
in interface WireIn
clear
in interface WireOut
clear
in class AbstractWire
@NotNull public @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes()
WireCommon
Bytes
stored by the wire.bytes
in interface WireCommon
bytes
in class AbstractWire
Bytes
stored by the wire@NotNull public @NotNull ValueOut write()
WireOut
@NotNull public @NotNull ValueOut write(@NotNull @NotNull WireKey key)
WireOut
@NotNull public @NotNull ValueOut write(@NotNull @NotNull CharSequence name)
public ValueOut writeEvent(Class expectedType, Object eventKey)
writeEvent
in interface WireOut
@NotNull public @NotNull WireOut dropDefault(boolean dropDefault)
dropDefault
in interface WireOut
@NotNull public @NotNull ValueOut getValueOut()
WireOut
getValueOut
in interface WireOut
@NotNull public @NotNull Wire writeComment(@NotNull @NotNull CharSequence s)
writeComment
in interface WireOut
@NotNull public @NotNull WireOut addPadding(int paddingToAdd)
addPadding
in interface WireOut
protected void escape0(@NotNull @NotNull CharSequence s, @NotNull @NotNull net.openhft.chronicle.wire.Quotes quotes)
@NotNull protected @NotNull net.openhft.chronicle.wire.Quotes needsQuotes(@NotNull @NotNull CharSequence s)
@NotNull public @NotNull net.openhft.chronicle.core.values.LongValue newLongReference()
WireCommon
LongValue
. The LongValue
implementation that is
returned depends on the wire implementation.newLongReference
in interface WireCommon
LongValue
@NotNull public @NotNull net.openhft.chronicle.core.values.BooleanValue newBooleanReference()
WireCommon
BooleanValue
. The BooleanValue
implementation that is
returned depends on the wire implementation.newBooleanReference
in interface WireCommon
BooleanValue
.@NotNull public @NotNull net.openhft.chronicle.core.values.IntValue newIntReference()
WireCommon
IntValue
. The IntValue
implementation that is
returned depends on the wire implementation.newIntReference
in interface WireCommon
IntValue
.@NotNull public @NotNull net.openhft.chronicle.core.values.LongArrayValues newLongArrayReference()
WireCommon
LongArrayValues
. The LongArrayValues
implementation that
is returned depends on the wire implementation.newLongArrayReference
in interface WireCommon
LongArrayValues
@NotNull public @NotNull net.openhft.chronicle.core.values.IntArrayValues newIntArrayReference()
WireCommon
IntArrayValues
. The IntArrayValues
implementation that
is returned depends on the wire implementation.newIntArrayReference
in interface WireCommon
IntArrayValues
public void parseWord(@NotNull @NotNull StringBuilder sb)
public void parseUntil(@NotNull @NotNull StringBuilder sb, @NotNull @NotNull net.openhft.chronicle.bytes.StopCharTester testers)
public void parseUntil(@NotNull @NotNull StringBuilder sb, @NotNull @NotNull net.openhft.chronicle.bytes.StopCharsTester testers)
public void append(@NotNull @NotNull CharSequence cs)
public void append(@NotNull @NotNull CharSequence cs, int offset, int length)
@Nullable public @Nullable Object readObject()
public void writeObject(Object o)
public void writeStartEvent()
WireOut
writeStartEvent
in interface WireOut
public void writeEndEvent()
writeEndEvent
in interface WireOut
Copyright © 2020. All rights reserved.