saffron.ext
Class ClassSchema

java.lang.Object
  |
  +--saffron.ext.ClassSchema
All Implemented Interfaces:
Schema

public class ClassSchema
extends Object
implements Schema

A ClassSchema is a schema whose tables are reflections of the the public fields of a given class.


Field Summary
private  Class clazz
           
private  boolean ignoreCase
           
 
Constructor Summary
ClassSchema(Class clazz, boolean ignoreCase)
           
 
Method Summary
private  Field findField(String name)
           
 Table getTableForMember(String name)
          Retrieves a Table based upon a member access.
 Table getTableForMethodCall(MethodCall call)
          Retrieves a Table based upon a method call (for example, salesSchema.empsInDept("SALES")).
protected  Expression getTarget(Expression connectionExp)
           
 TypeFactory getTypeFactory()
          Returns the type factory used to generate types for this schema.
 void registerRules(Planner planner)
          Registers all of the rules supported by this schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

private final Class clazz

ignoreCase

private final boolean ignoreCase
Constructor Detail

ClassSchema

public ClassSchema(Class clazz,
                   boolean ignoreCase)
Method Detail

getTypeFactory

public TypeFactory getTypeFactory()
Description copied from interface: Schema
Returns the type factory used to generate types for this schema.

Specified by:
getTypeFactory in interface Schema

getTableForMember

public Table getTableForMember(String name)
Description copied from interface: Schema
Retrieves a Table based upon a member access.

For example, the Saffron expression salesSchema.emps would be resolved using a call to salesSchema.getTableForMember(typeFactory, "emps").

Specified by:
getTableForMember in interface Schema

findField

private Field findField(String name)

getTarget

protected Expression getTarget(Expression connectionExp)

getTableForMethodCall

public Table getTableForMethodCall(MethodCall call)
Description copied from interface: Schema
Retrieves a Table based upon a method call (for example, salesSchema.empsInDept("SALES")).

Specified by:
getTableForMethodCall in interface Schema

registerRules

public void registerRules(Planner planner)
                   throws Exception
Description copied from interface: Schema
Registers all of the rules supported by this schema. Only called by Planner.registerSchema(saffron.Schema).

Specified by:
registerRules in interface Schema
Exception

SourceForge.net_Logo