|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.endeca.portal.data.functions.QueryFunction
public abstract class QueryFunction
The base class of all QueryFunctions. Wraps functionality for serializing and deserializing, cloning, and comparing. Refer to subclasses for specific types of functions.
QueryFilter
or QueryConfig
, not this class directly.
Other than that, simply pay attention to the abstract methods in this class
and your toString()
implementation.
QueryFilter
,
QueryConfig
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
CLASS_PROPERTY
|
Constructor Summary | |
---|---|
protected |
QueryFunction()
|
Method Summary | ||
---|---|---|
abstract void |
applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.Request query)
Apply this function to a Request. |
|
QueryFunction |
clone()
|
|
boolean |
equals(java.lang.Object other)
|
|
boolean |
equals(QueryFunction other)
Compares two QueryFunction instances by checking class types and using the object's toString() method |
|
abstract java.util.List<java.lang.reflect.Method> |
getGetters()
Return the list of property getters on this function. |
|
static
|
getInstance(java.lang.Class<T> klass,
org.json.JSONObject init)
convenience function to instantiate a new function from a JSON configuration. |
|
static
|
getInstance(org.json.JSONObject init)
|
|
java.lang.String |
getName()
Retrieve the name. |
|
abstract java.util.List<java.lang.reflect.Method> |
getSetters()
Return the list of property setters on this function. |
|
int |
hashCode()
|
|
void |
init(org.json.JSONObject json)
Initialize this instance from a JSON configuration. |
|
void |
setName(java.lang.String name)
Set the name. |
|
org.json.JSONObject |
toJSON()
Construct a JSON representation of this function. |
|
abstract java.lang.String |
toString()
This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be consistent and deterministic. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_PROPERTY
Constructor Detail |
---|
protected QueryFunction()
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic static <T extends QueryFunction> T getInstance(java.lang.Class<T> klass, org.json.JSONObject init) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, org.json.JSONException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
T
- klass
- the class of the function to initializeinit
- the JSON representation of the function to initialize
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
org.json.JSONException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
public static <T extends QueryFunction> T getInstance(org.json.JSONObject init) throws org.json.JSONException, java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
org.json.JSONException
java.lang.ClassNotFoundException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
public void init(org.json.JSONObject json) throws org.json.JSONException
json
- the JSON configuration
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
org.json.JSONException
toJSON()
public abstract void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.Request query) throws QueryFunctionUnsupportedException
query
-
QueryFunctionUnsupportedException
public abstract java.util.List<java.lang.reflect.Method> getGetters()
private static List getters = Reflection.getGetters(MyFunctionClass.class);
\@Override
public List getGetters() {
return getters;
}
public abstract java.util.List<java.lang.reflect.Method> getSetters()
private static List setters = Reflection.getSetters(MyFunctionClass.class);
\@Override
public List getSetters() {
return setters;
}
public org.json.JSONObject toJSON()
init(JSONObject)
public abstract java.lang.String toString()
toString
in class java.lang.Object
public QueryFunction clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean equals(QueryFunction other)
other
-
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |