dsql.value
Class JavaObject

java.lang.Object
  extended bydsql.DMExecuted
      extended bydsql.value.Value
          extended bydsql.value.NonScalarValue
              extended bydsql.value.JavaObject
Direct Known Subclasses:
List

public class JavaObject
extends NonScalarValue

A holder for a Java object. The columns correspond to fields, if they are available, or getX methods


Field Summary
protected  java.lang.Object obj
           
 
Constructor Summary
JavaObject(DSQL _caller, java.lang.Object _obj)
           
 
Method Summary
static JavaObject create(DSQL _caller, java.lang.Object obj)
           
 boolean getBoolean()
           
 ConstructedResults getMeta()
           
 java.lang.Object getObject()
          Attempt to return a Java object, e.g.
 java.lang.Class getObjectClass()
          return the object class; some scalars return the primitive class (eg Integer.TYPE, rather than Integer.getClass()
 java.lang.String getString()
           
 void print(ASTPrint printer)
          Print this value using printer
 java.lang.String toString()
           
 
Methods inherited from class dsql.value.NonScalarValue
getField, getFields, isScalar, setField
 
Methods inherited from class dsql.value.Value
getFloat, getInt, getRecordHolder, getType, getValue, getValue
 
Methods inherited from class dsql.DMExecuted
getCaller, setCaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

obj

protected java.lang.Object obj
Constructor Detail

JavaObject

public JavaObject(DSQL _caller,
                  java.lang.Object _obj)
Method Detail

getObject

public java.lang.Object getObject()
Description copied from class: Value
Attempt to return a Java object, e.g. StringValue returns String, JavaObject returns the embedded object, etc. This is used when passing values to java constructors and methods

Overrides:
getObject in class Value

getObjectClass

public java.lang.Class getObjectClass()
Description copied from class: Value
return the object class; some scalars return the primitive class (eg Integer.TYPE, rather than Integer.getClass()

Overrides:
getObjectClass in class Value

print

public void print(ASTPrint printer)
           throws ExecuteException
Description copied from class: Value
Print this value using printer

Specified by:
print in class Value
Throws:
ExecuteException

getString

public java.lang.String getString()
Specified by:
getString in class Value
Returns:
a string representation of this value, to be used within dsql expressions. This is distinct from toString(), which is used to output the object for debugging purposes.

toString

public java.lang.String toString()

getMeta

public ConstructedResults getMeta()
                           throws ExecuteException
Specified by:
getMeta in class Value
Returns:
meta-information about this Value, e.g. for a table, it returns the names,types,width,etc. of its columns.
Throws:
ExecuteException

getBoolean

public boolean getBoolean()
Specified by:
getBoolean in class Value
Returns:
true if this Value is "non-zero", e.g. non-empty string, tables has some record, etc.

create

public static JavaObject create(DSQL _caller,
                                java.lang.Object obj)