public abstract class Frame extends FrameComponent implements Transportable
Modifier | Constructor and Description |
---|---|
protected |
Frame() |
Modifier and Type | Method and Description |
---|---|
void |
add(String tag,
FrameComponent val)
Add a tagged value to this frame (value is either a Frame or FrameLeaf).
|
FrameLeaf |
createFrameLeaf(byte[] array)
Factory method used by fromStream when it needs to create a frame leaf.
|
Frame |
createSubFrame(String tag_name,
int initialCapacity)
Factory method used by fromStream when it needs to create a sub-frame.
|
Frame |
fadd(String key)
Decorator method for adding a valueless tag.
|
Frame |
fadd(String key,
boolean val)
Decorator method for adding boolean valued tags.
|
Frame |
fadd(String key,
byte[] val)
Decorator method for adding binary valued tags.
|
Frame |
fadd(String key,
double val)
Decorator method for adding double valued tags.
|
Frame |
fadd(String key,
double[] val)
Decorator method for adding double-array valued tags.
|
Frame |
fadd(String key,
float val)
Decorator method for adding float-valued tags.
|
Frame |
fadd(String key,
float[] val)
Decorator method for adding float-array valued tags.
|
Frame |
fadd(String key,
Frame val)
Decorator method for adding Frame-valued tags.
|
Frame |
fadd(String key,
int val)
Decorator method for adding int valued tags.
|
Frame |
fadd(String key,
int[] val)
Decorator method for adding int-array valued tags.
|
Frame |
fadd(String key,
long val)
Decorator method for adding long valued tags.
|
Frame |
fadd(String key,
long[] val)
Decorator method for adding long-array valued tags.
|
Frame |
fadd(String key,
String val)
Decorator method for adding String valued tags.
|
Frame |
fadd(String key,
String[] val)
Decorator method for adding String-array valued tags.
|
Frame |
faddTrueBinary(String key,
byte[] val)
This is a hack method which allows you to add binary-valued tags to Frames in a manner such
that there is no textual encoding overhead of that binary data.
|
KeyValuePair |
fromStream(InputStream is)
Populate this document using the given InputStream and the installed marshaller.
|
static FrameTransporter |
getFrameTransporter()
Get the currently installed document marshaller.
|
KeyValuePair |
getKeyValuePair(int which)
Return the specified KeyValue pair.
|
int |
getKeyValuePairCount()
Return the number of key/value pairs within this frame.
|
static void |
setFrameTransporter(FrameTransporter transporter)
This method lets you replace the default XTalk marshaller with another one, for example if you
want to use a different wire format (such as XML/SOAP), or if you want to easily exploit an
optimized/native implementation.
|
String |
toRawXML()
Convert the document to XML without any pretting printing.
|
StringBuffer |
toRawXML(StringBuffer buf)
Convert the document to XML without any pretting printing.
|
void |
toRawXMLWork(StringBuffer rval) |
void |
toStream(OutputStream os)
Write this document to the given output stream using the installed marshaller.
|
String |
toString()
Represent the document as a string (equivlent to toXML()).
|
String |
toXML()
Convert the document to XML.
|
StringBuffer |
toXML(StringBuffer buf)
Append the document, in XML format, to the provided StringBuffer.
|
protected void |
toXML(StringBuffer rval,
int offset)
Helper method for toXML(StringBuffer).
|
getAttributes, setAttributes
public static void setFrameTransporter(FrameTransporter transporter)
transporter
- The new marshaller to plug in.public static FrameTransporter getFrameTransporter()
public void add(String tag, FrameComponent val)
tag
- The tag name with which to associate the value.val
- The (Frame | FrameLeaf) value to associate with the tag.UnsupportedOperationException
- not implementedpublic KeyValuePair getKeyValuePair(int which)
which
- The index of the KeyValuePair to retrieve.UnsupportedOperationException
- not implementedpublic int getKeyValuePairCount()
UnsupportedOperationException
- not implementedpublic KeyValuePair fromStream(InputStream is) throws IOException, EOFException
fromStream
in interface Transportable
is
- The input stream to read from.IOException
- Can come from the underlying input stream.UnsupportedOperationException
- if this document model does not support key addition.EOFException
public void toStream(OutputStream os) throws IOException
toStream
in interface Transportable
os
- The stream to where the document is written.IOException
- Can come from the underlying output stream.UnsupportedOperationException
- if this document model does not support key iteration.public String toString()
toString
in class Object
UnsupportedOperationException
- if this document model does not support key iteration.public String toXML()
UnsupportedOperationException
- if this document model does not support key iteration.public String toRawXML()
UnsupportedOperationException
- if this document model does not support key iteration.public StringBuffer toRawXML(StringBuffer buf)
buf
- The StringBuffer to append the document text to.UnsupportedOperationException
- if this document model does not support key iteration.public void toRawXMLWork(StringBuffer rval)
public StringBuffer toXML(StringBuffer buf)
buf
- The StringBuffer where the document is appended.UnsupportedOperationException
- if this document model does not support key iteration.public FrameLeaf createFrameLeaf(byte[] array)
public Frame createSubFrame(String tag_name, int initialCapacity)
UnsupportedOperationException
- if the getClass().newInstance() call on this object results in an exception.protected void toXML(StringBuffer rval, int offset)
public Frame fadd(String key, float val)
key
- The key to be associated with the value.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, float[] val)
key
- The key to be associated with the value.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, double val)
key
- The key to be associated with the value.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, double[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, int val)
key
- The key to be associated with the value.val
- The int to add.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, int[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, long val)
key
- The key to be associated with the value.val
- The long value to add.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, long[] val)
key
- The key to be associated with the value.val
- The array to add. The array is immediately converted to string representation.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, String val)
key
- The key to be associated with the value.val
- The string to add.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, String[] val)
key
- The key to be associated with the value.val
- The string to add.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, byte[] val)
key
- The key to be associated with the value.val
- The binary data to add (will be Base64 encoded).UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, boolean val)
key
- The key to be associated with the value.val
- The boolean value to add.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key, Frame val)
key
- The key to be associated with the value.val
- The sub-frame to add. Note this frame is not copied.UnsupportedOperationException
- if this document model doesn't support key addition.public Frame fadd(String key)
key
- The key name.UnsupportedOperationException
- if this document model doesn't support key addition, or creation of empty sub-frames.public Frame faddTrueBinary(String key, byte[] val)
key
- The key to be associated with the value.val
- The byte array to be added to the frame. Note the array is NOT copied or converted in
any way.UnsupportedOperationException
- if this document model doesn't support key addition.Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.