|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.kernel.Filters
public class Filters
Helper methods for dealing with query filters.
Constructor Summary | |
---|---|
Filters()
|
Method Summary | |
---|---|
static Object |
add(Object o1,
Class<?> c1,
Object o2,
Class<?> c2)
Add the given values. |
static List<ClassMetaData> |
addAccessPathMetaDatas(List<ClassMetaData> metas,
ClassMetaData[] path)
Add the given access path metadatas to the full path list, making sure to maintain only base metadatas in the list. |
static boolean |
canConvert(Class<?> c1,
Class<?> c2,
boolean strict)
Return whether an instance of the first class can be converted to an instance of the second. |
static String |
clip(String s,
String first,
String last,
boolean fail)
Removes the first and last string if they are the terminal sequence in the given string. |
static Object |
convert(Object o,
Class<?> type)
|
static Object |
convert(Object o,
Class<?> type,
boolean strictNumericConversion)
Convert the given value to the given type. |
static Object |
convertToMatchMethodArgument(Object o,
Method method)
Convert the given value to match the given (presumably a setter) method argument type. |
static Object |
divide(Object o1,
Class<?> c1,
Object o2,
Class<?> c2)
Divide the given values. |
static Object |
getDefaultForNull(Class<?> nType)
|
static AggregateListener |
hintToAggregateListener(Object hint,
ClassLoader loader)
Convert the user-given hint value to an aggregate listener. |
static AggregateListener[] |
hintToAggregateListeners(Object hint,
ClassLoader loader)
Convert the user-given hint value to an array of aggregate listeners. |
static FilterListener |
hintToFilterListener(Object hint,
ClassLoader loader)
Convert the user-given hint value to a filter listener. |
static FilterListener[] |
hintToFilterListeners(Object hint,
ClassLoader loader)
Convert the user-given hint value to an array of filter listeners. |
static Object |
hintToGetter(Object target,
String hintKey)
Return the value of the property named by the hint key. |
static void |
hintToSetter(Object target,
String hintKey,
Object value)
Set the value of the property named by the hint key. |
static boolean |
isJDBCTemporalSyntax(String s)
Affirms if the given String is enclosed in {}. |
static boolean |
isTemporalType(Class<?> c)
Affirms if the given class is Data, Time or Timestamp. |
static Object |
mod(Object o1,
Class<?> c1,
Object o2,
Class<?> c2)
Mod the given values. |
static Object |
multiply(Object o1,
Class<?> c1,
Object o2,
Class<?> c2)
Multiply the given values. |
static List<String> |
parseDeclaration(String dec,
char split,
String decType)
Parses the given declarations into a list of type, name, type, name... |
static Object |
parseJDBCTemporalSyntax(String s)
Parses the given string assuming it is a JDBC key expression. |
static Class<?> |
promote(Class<?> c1,
Class<?> c2)
Given two types, return type they should both be converted to before performing any operations between them. |
static List<String> |
splitExpressions(String str,
char split,
int expected)
Split the given expression list into distinct expressions. |
static Object |
subtract(Object o1,
Class<?> c1,
Object o2,
Class<?> c2)
Subtract the given values. |
static Class<?> |
unwrap(Class<?> c)
Return the correct primitive type for the given class, if it is a wrapper. |
static Class<?> |
wrap(Class<?> c)
Return the correct wrapper type for the given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Filters()
Method Detail |
---|
public static Class<?> wrap(Class<?> c)
public static Class<?> unwrap(Class<?> c)
public static Class<?> promote(Class<?> c1, Class<?> c2)
public static boolean canConvert(Class<?> c1, Class<?> c2, boolean strict)
public static Object convertToMatchMethodArgument(Object o, Method method)
o
- given valuemethod
- a presumably setter method
public static Object convert(Object o, Class<?> type)
public static Object convert(Object o, Class<?> type, boolean strictNumericConversion)
public static Object add(Object o1, Class<?> c1, Object o2, Class<?> c2)
public static Object subtract(Object o1, Class<?> c1, Object o2, Class<?> c2)
public static Object multiply(Object o1, Class<?> c1, Object o2, Class<?> c2)
public static Object divide(Object o1, Class<?> c1, Object o2, Class<?> c2)
public static Object mod(Object o1, Class<?> c1, Object o2, Class<?> c2)
public static List<String> parseDeclaration(String dec, char split, String decType)
decType
- the type of declaration being parsed, for use in
error messagespublic static List<String> splitExpressions(String str, char split, int expected)
public static List<ClassMetaData> addAccessPathMetaDatas(List<ClassMetaData> metas, ClassMetaData[] path)
public static AggregateListener hintToAggregateListener(Object hint, ClassLoader loader)
public static AggregateListener[] hintToAggregateListeners(Object hint, ClassLoader loader)
public static FilterListener hintToFilterListener(Object hint, ClassLoader loader)
public static FilterListener[] hintToFilterListeners(Object hint, ClassLoader loader)
public static Object hintToGetter(Object target, String hintKey)
public static void hintToSetter(Object target, String hintKey, Object value)
public static Object parseJDBCTemporalSyntax(String s)
public static boolean isJDBCTemporalSyntax(String s)
public static String clip(String s, String first, String last, boolean fail)
s
- a string to be examinedfirst
- the characters in the beginning of the given stringlast
- the characters in the end of the given stringfail
- if true throws exception if the given string does not have the given terminal sequences.
public static boolean isTemporalType(Class<?> c)
public static Object getDefaultForNull(Class<?> nType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |