|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.vinci.transport.FrameComponent
org.apache.vinci.transport.Frame
org.apache.vinci.transport.QueryableFrame
public abstract class QueryableFrame
QueryableFrame is a decorator class that extends Frame. While the Frame decorates its descendents with adder methods for building an XML document, the QueryableFrame further decorates its descendents with getter methods that provide simple "declarative" querying of document values. This supports the important Vinci convention of declarative value access to support evolving service schemas. Descendents of QueryableFrame need only implement the abstract fget(String key) and fgetFirst(String key) methods. Typically you will use VinciFrame, an immediate and concrete descendent of QueryableFrame, for most of your code. QueryableFrame can be extended to simplify implementation of alternate Frame implementations should VinciFrame be inadequate for whatever reason. Note that the getters of QueryableFrame do not search the document recursively. That is, they only search the "top level" tags within the Frame. More sophisticated document search methods should probably be added in orthogonal query processing classes, such as through an XPathProcessor class that understands the QueryableFrame interface.
Constructor Summary | |
---|---|
QueryableFrame()
|
Method Summary | |
---|---|
abstract java.util.ArrayList |
fget(java.lang.String key)
This method must be implemented so that it returns ALL values paired with the specified key in ArrayList format. |
boolean |
fgetBoolean(java.lang.String key)
Retrieve the value of the specified key as a boolean. |
byte[] |
fgetBytes(java.lang.String key)
Presuming the data identified by this key is Base64 data, returns the binary array result of Base64 decoding that data. |
double |
fgetDouble(java.lang.String key)
Retrieve the value of the specified key as a double. |
double[] |
fgetDoubleArray(java.lang.String key)
Retrieve the value of the specified key as an array of doubles. |
abstract FrameComponent |
fgetFirst(java.lang.String key)
This method must be implemented so that it returns only the FIRST value paired with the specified key. |
float |
fgetFloat(java.lang.String key)
Retrieve the value of the specified key as a float. |
float[] |
fgetFloatArray(java.lang.String key)
Retrieve the value of the specified key as an array of floats. |
QueryableFrame |
fgetFrame(java.lang.String key)
Retrieve the value of the specified key as a QueryableFrame. |
int |
fgetInt(java.lang.String key)
Retrieve the value of the specified key as a int. |
int[] |
fgetIntArray(java.lang.String key)
Retrieve the value of the specified key as an array of ints. |
long |
fgetLong(java.lang.String key)
Retrieve the value of the specified key as a long. |
long[] |
fgetLongArray(java.lang.String key)
Retrieve the value of the specified key as an array of longs. |
java.lang.String |
fgetString(java.lang.String key)
Retrieve the value of the specified key as a String. |
java.lang.String[] |
fgetStringArray(java.lang.String key)
Retrieve the value of the specified key as a String array. |
byte[] |
fgetTrueBinary(java.lang.String key)
This is a "non-XTalk-1.0" hack to allow retrieving any data that was transported as "true binary" (non Base64 encoded), for example via Frame.faddTrueBinary(String, byte[]) instead of Frame.fadd(String, byte[]). |
Methods inherited from class org.apache.vinci.transport.Frame |
---|
add, createFrameLeaf, createSubFrame, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, faddTrueBinary, fromStream, getFrameTransporter, getKeyValuePair, getKeyValuePairCount, setFrameTransporter, toRawXML, toRawXML, toRawXMLWork, toStream, toString, toXML, toXML, toXML |
Methods inherited from class org.apache.vinci.transport.FrameComponent |
---|
getAttributes, setAttributes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryableFrame()
Method Detail |
---|
public abstract java.util.ArrayList fget(java.lang.String key)
key
- The key identifying the values to retrieve.
public abstract FrameComponent fgetFirst(java.lang.String key)
key
- The key identifying the value to retrieve.
public byte[] fgetBytes(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested data is not B64.
java.lang.ClassCastException
- thrown if the specified frame component is not a leaf.public byte[] fgetTrueBinary(java.lang.String key)
key
- The key identifying the value to retrieve.
java.lang.ClassCastException
- thrown if the specified frame component is not a leaf.public boolean fgetBoolean(java.lang.String key)
key
- The key identifying the value to be retrieved.
java.lang.ClassCastException
- if the specified value is not a leaf.public float fgetFloat(java.lang.String key) throws LeafCastException
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested value could not be converted to a float.
java.lang.ClassCastException
- if the specified value is not a leaf.public float[] fgetFloatArray(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if *any* of the space-separated tokens cannot be converted to
float.
java.lang.ClassCastException
- if the specified value is not a leaf.public double fgetDouble(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested value could not be converted to a double.
java.lang.ClassCastException
- if the specified value is not a leaf.public double[] fgetDoubleArray(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if *any* of the space-separated tokens cannot be converted to
double.
java.lang.ClassCastException
- if the specified value is not a leaf.public int fgetInt(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested value could not be converted to a int.
java.lang.ClassCastException
- if the specified value is not a leaf.public int[] fgetIntArray(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if *any* of the space-separated tokens cannot be converted to
int.
java.lang.ClassCastException
- if the specified value is not a leaf.public long fgetLong(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested value could not be converted to a long.
java.lang.ClassCastException
- if the specified value is not a leaf.public long[] fgetLongArray(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if *any* of the space-separated tokens cannot be converted to
long.
java.lang.ClassCastException
- if the specified value is not a leaf.public java.lang.String fgetString(java.lang.String key)
key
- The key identifying the value to retrieve.
public java.lang.String[] fgetStringArray(java.lang.String key)
key
- The key identifying the value to retrieve.
LeafCastException
- (unchecked) thrown if the requested value is not a properly encoded string array.
java.lang.ClassCastException
- if the specified value is not a leaf.public QueryableFrame fgetFrame(java.lang.String key)
key
- The key identifying the value to retrieve.
java.lang.ClassCastException
- (unchecked) if the value was not of type QueryableFrame.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |