public class YamlWire extends AbstractWire implements Wire
WireIn.HeaderType| Modifier and Type | Field and Description |
|---|---|
static net.openhft.chronicle.bytes.BytesStore |
TYPE |
bytes, classLookup, commentListener, DEFAULT_USE_PADDING, parent, use8bitMARSHALLABLE_IN_INTERN_SIZE| Constructor and Description |
|---|
YamlWire(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes) |
YamlWire(@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() |
YamlWire |
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. |
void |
clear()
Resets the state of the underlying
Bytes stored by the wire. |
protected void |
consumeDocumentStart() |
void |
consumePadding() |
void |
copyTo(@NotNull WireOut wire) |
protected @NotNull net.openhft.chronicle.wire.YamlWire.TextValueIn |
createValueIn() |
protected @NotNull net.openhft.chronicle.wire.YamlWire.TextValueOut |
createValueOut() |
@NotNull WireOut |
dropDefault(boolean dropDefault) |
String |
dumpContext() |
void |
endEvent() |
protected void |
escape0(@NotNull CharSequence s,
@NotNull net.openhft.chronicle.wire.Quotes quotes) |
static @NotNull YamlWire |
from(@NotNull String text) |
static @NotNull YamlWire |
fromFile(String name) |
@NotNull ValueIn |
getValueIn()
Obtain the value in for advanced use (typically after a call to readEvent above)
|
@NotNull ValueOut |
getValueOut()
Obtain the value out
|
boolean |
hasMetaDataPrefix() |
boolean |
hintReadInputOrder() |
protected void |
initReadContext() |
boolean |
isBinary()
Determine whether direct access to the underlying byte() makes sense or should it be treated as text
|
boolean |
isEndEvent() |
boolean |
isNotEmptyAfterPadding()
This consumes any padding before checking if readRemaining() > 0
|
@NotNull VanillaMethodReaderBuilder |
methodReaderBuilder() |
<T> T |
methodWriter(@NotNull Class<T> tClass,
Class... additional)
Proxy an interface so each message called is written for replay.
|
<T> @NotNull net.openhft.chronicle.bytes.MethodWriterBuilder<T> |
methodWriterBuilder(@NotNull Class<T> tClass)
Return a builder for a proxy an interface so each message called is written for method.
|
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. |
@NotNull ValueIn |
read()
Read the field if present, or empty string if not present.
|
@NotNull ValueIn |
read(String keyName) |
@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.
|
@NotNull Wire |
readComment(@NotNull StringBuilder s) |
boolean |
readDocument(long position,
@Nullable ReadMarshallable metaDataConsumer,
@Nullable ReadMarshallable dataConsumer) |
boolean |
readDocument(@Nullable ReadMarshallable metaDataConsumer,
@Nullable ReadMarshallable dataConsumer) |
<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() |
void |
reset()
Reset the state of the wire
|
void |
startEvent() |
String |
toString() |
boolean |
trimFirstCurly() |
YamlWire |
trimFirstCurly(boolean trimFirstCurly) |
@NotNull YamlWire |
useBinaryDocuments() |
boolean |
useSelfDescribingMessage(@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
Should this wire write the object as a Marshallable or BytesMarshallable
|
@NotNull YamlWire |
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)
Deprecated.
|
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, classLookup, classLookup, commentListener, 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, writeFirstHeaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitheaderNumber, newYamlWireOnHeapasText, commentListener, hasMore, isEmpty, objectInput, rawReadData, readAlignTo, readAllAsMap, readAndSetLength, readDataHeader, readDataHeader, readEventName, readFirstHeader, readFirstHeader, readMetaDataHeadermethodReader, readBytes, readBytes, readDocument, readMap, readText, readTextenterHeader, objectOutput, padToCacheAlign, updateFirstHeader, updateHeader, writeAlignTo, writeAllAsMap, writeDocument, writeEndOfWire, writeEventId, writeEventId, writeEventName, writeEventName, writeFirstHeader, writeNotCompleteDocument, writingDocumentbytesComment, classLookup, classLookup, endUse, headerNumber, newTwoLongReference, notCompleteIsNotPresent, notCompleteIsNotPresent, parent, parent, pauser, pauser, startUse, usePadding, usePaddingbuilder, methodWriter, methodWriterBuilder, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeTextpublic YamlWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean use8bit)
public YamlWire(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
@NotNull public static @NotNull YamlWire fromFile(String name) throws IOException
fromFile in interface WireIOExceptionpublic boolean isBinary()
WireCommonisBinary in interface WireCommonpublic boolean hintReadInputOrder()
hintReadInputOrder in interface WireInpublic boolean addTimeStamps()
public YamlWire addTimeStamps(boolean addTimeStamps)
@NotNull
public <T> T methodWriter(@NotNull
@NotNull Class<T> tClass,
Class... additional)
MarshallableOutmethodWriter in interface MarshallableOuttClass - primary interfaceadditional - any additional interfaces@NotNull
public <T> @NotNull net.openhft.chronicle.bytes.MethodWriterBuilder<T> methodWriterBuilder(@NotNull
@NotNull Class<T> tClass)
MarshallableOutmethodWriterBuilder in interface MarshallableOuttClass - primary interface@NotNull public @NotNull VanillaMethodReaderBuilder methodReaderBuilder()
methodReaderBuilder in interface MarshallableIn@NotNull public @NotNull DocumentContext writingDocument(boolean metaData)
WireOutwritingDocument in interface DocumentWrittenwritingDocument in interface MarshallableOutwritingDocument in interface WireOutmetaData - if true the document context will be used for writing meta data,
otherwise datapublic DocumentContext acquireWritingDocument(boolean metaData)
MarshallableOutacquireWritingDocument in interface DocumentWrittenacquireWritingDocument in interface MarshallableOutacquireWritingDocument in interface WireOut@NotNull public @NotNull DocumentContext readingDocument()
WireInWireIn.readDocument(net.openhft.chronicle.wire.ReadMarshallable,
net.openhft.chronicle.wire.ReadMarshallable) but with out the use of a lambda expressionreadingDocument in interface MarshallableInreadingDocument in interface WireInprotected void initReadContext()
@NotNull public @NotNull YamlWire useBinaryDocuments()
@NotNull public @NotNull YamlWire useTextDocuments()
@NotNull public @NotNull DocumentContext readingDocument(long readLocation)
readingDocument in interface WireIn@NotNull protected @NotNull net.openhft.chronicle.wire.YamlWire.TextValueOut createValueOut()
@NotNull protected @NotNull net.openhft.chronicle.wire.YamlWire.TextValueIn createValueIn()
public long readEventNumber()
readEventNumber in interface WireInreadEventNumber 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)
WireInUse getValueIn() to read the value for this event
public boolean isNotEmptyAfterPadding()
WireInNOTE: This method only works inside a document. Call it just before a document and it won't know not to read the read in case there is padding.
isNotEmptyAfterPadding in interface WireInpublic void consumePadding()
consumePadding in interface WireIn@NotNull public @NotNull String readingPeekYaml()
readingPeekYaml in interface WireIn@NotNull public @NotNull ValueIn read(@NotNull @NotNull WireKey key)
WireInpublic String dumpContext()
@NotNull public @NotNull ValueIn read(@NotNull @NotNull StringBuilder name)
WireIn@NotNull public @NotNull ValueIn getValueIn()
WireIngetValueIn in interface WireIn@NotNull public @NotNull Wire readComment(@NotNull @NotNull StringBuilder s)
readComment in interface WireInpublic void clear()
WireCommonBytes stored by the wire.clear in interface WireCommonclear in interface WireInclear in interface WireOutclear in class AbstractWire@NotNull public @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes()
WireCommonBytes stored by the wire.bytes in interface WireCommonbytes in class AbstractWireBytes 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()
WireOutgetValueOut 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 WireOutprotected 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)
protected void consumeDocumentStart()
@NotNull public @NotNull net.openhft.chronicle.core.values.LongValue newLongReference()
WireCommonLongValue. The LongValue implementation that is
returned depends on the wire implementation.newLongReference in interface WireCommonLongValue@NotNull public @NotNull net.openhft.chronicle.core.values.BooleanValue newBooleanReference()
WireCommonBooleanValue. The BooleanValue implementation that is
returned depends on the wire implementation.newBooleanReference in interface WireCommonBooleanValue.public boolean useSelfDescribingMessage(@NotNull
@NotNull net.openhft.chronicle.bytes.CommonMarshallable object)
WireCommonuseSelfDescribingMessage in interface WireCommon@NotNull public @NotNull net.openhft.chronicle.core.values.IntValue newIntReference()
WireCommonIntValue. The IntValue implementation that is
returned depends on the wire implementation.newIntReference in interface WireCommonIntValue.@NotNull public @NotNull net.openhft.chronicle.core.values.LongArrayValues newLongArrayReference()
WireCommonLongArrayValues. The LongArrayValues implementation that
is returned depends on the wire implementation.newLongArrayReference in interface WireCommonLongArrayValues@NotNull public @NotNull net.openhft.chronicle.core.values.IntArrayValues newIntArrayReference()
WireCommonIntArrayValues. The IntArrayValues implementation that
is returned depends on the wire implementation.newIntArrayReference in interface WireCommonIntArrayValuespublic void append(@NotNull
@NotNull CharSequence cs)
public void append(@NotNull
@NotNull CharSequence cs,
int offset,
int length)
@Deprecated public void writeObject(Object o)
valueIn().object(o)) instead.public void writeStartEvent()
WireOutwriteStartEvent in interface WireOutpublic void writeEndEvent()
writeEndEvent in interface WireOutpublic boolean trimFirstCurly()
public YamlWire trimFirstCurly(boolean trimFirstCurly)
trimFirstCurly - whether the top level curly brackets is droppedpublic void startEvent()
startEvent in interface WireInpublic boolean isEndEvent()
isEndEvent in interface WireInpublic void reset()
WireCommonreset in interface WireCommonpublic boolean hasMetaDataPrefix()
hasMetaDataPrefix in interface WireInpublic boolean readDocument(@Nullable
@Nullable ReadMarshallable metaDataConsumer,
@Nullable
@Nullable ReadMarshallable dataConsumer)
readDocument in interface WireInpublic boolean readDocument(long position,
@Nullable
@Nullable ReadMarshallable metaDataConsumer,
@Nullable
@Nullable ReadMarshallable dataConsumer)
readDocument in interface WireInCopyright © 2022. All rights reserved.