Package com.storedobject.core
Class StoredObjectUtility
java.lang.Object
com.storedobject.core.StoredObjectUtility
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
StoredObjectUtility.Link<L extends StoredObject>
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringList
browseColumns
(Class<? extends StoredObject> objectClass) static String
browseOrder
(Class<? extends StoredObject> objectClass) static <T extends StoredObject>
booleanchanged
(T newObject, T oldObject, StyledBuilder changes) static ClassAttribute
<? extends StoredObject> classAttribute
(int family) static <T extends StoredObject>
ClassAttribute<T> classAttribute
(Class<T> objectClass) static <T extends StoredObject>
ClassAttribute<T> classAttribute
(T object) static String[]
createDDL
(Class<? extends StoredObject> objectClass) static StoredObjectUtility.Link
<?> createLink
(Class<? extends StoredObject> masterClass, String linkDetails) static Method
createMethod
(Class<?> objectClass, String attributeName) createMethodList
(Class<?> objectClass, String attributeName) static StoredObjectUtility.MethodList[]
createMethodLists
(Class<?> objectClass, StringList attributeNames) static Method[]
createMethods
(Class<?> objectClass, String[] attributeNames) static String
createSQL
(ClassAttribute<?> ca, String columns, String condition, String order, boolean only, boolean header, int skip, int limit, int[] distinct) Create a SQL execution string.static StringList
displayColumns
(Class<? extends StoredObject> objectClass) static String[]
dropDDL
(Class<? extends StoredObject> objectClass) static <O extends StoredObject>
StringBuilderdump
(StoredObject object, StringBuilder buffer) static Object
emptyValue
(Class<?> p) static boolean
static void
executeRaw
(Method method, Object object, Object objectValue) static <T extends StoredObject>
intstatic String[]
foreignKeysDDL
(Class<? extends StoredObject> objectClass) static <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic Class
<? extends StoredObject> getObjectClass
(String className) static Query
getTransactionLog
(SystemUser su, Timestamp from, Timestamp to) static int
hints
(Class<? extends StoredObject> objectClass) static int
howBig
(Class<? extends StoredObject> objectClass, boolean any) static Properties
initialize
(File properties) static Properties
initialize
(File properties, Properties variables) static Properties
static Properties
initialize
(InputStream in, Properties variables) static Properties
initialize
(String propertiesFileName) static Properties
initialize
(String propertiesFileName, Properties variables) static Properties
initialize
(Properties properties) static Properties
initialize
(Properties properties, Properties variables) static ArrayList
<StoredObjectUtility.Link<?>> linkDetails
(Class<? extends StoredObject> masterClass) static ArrayList
<StoredObjectUtility.Link<?>> linkDetails
(Class<? extends StoredObject> masterClass, StringList extraLinks) static StringList
links
(Class<? extends StoredObject> masterClass) static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static StringList
protectedColumns
(Class<? extends StoredObject> objectClass) static String[]
reindex
(Class<? extends StoredObject> objectClass) static <O extends StoredObject>
OretrieveObject
(Class<O> objectClass, Object value) Retrieve an instance of theStoredObject
from the value provided.static boolean
sameContent
(TransactionManager tm, StoredObject one, StoredObject two) static StringList
searchColumns
(Class<? extends StoredObject> objectClass) static String
static String
stackTrace
(int count) static String
stackTrace
(int count, boolean includeCore) static String
stackTrace
(int count, boolean includeCore, int skip) static int
statusUI
(Class<? extends StoredObject> objectClass) static void
substituteVariables
(Properties properties, Properties variables) static String
static String
static <O extends StoredObject>
StringtoString
(StoredObject object) static <O extends StoredObject>
StringtoString
(StoredObject object, boolean showAttributes)
-
Constructor Details
-
StoredObjectUtility
public StoredObjectUtility()
-
-
Method Details
-
classAttribute
-
family
-
classAttribute
-
classAttribute
-
createDDL
- Throws:
Exception
-
foreignKeysDDL
-
dropDDL
-
reindex
-
substituteVariables
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
howBig
-
hints
-
statusUI
-
displayColumns
-
searchColumns
-
protectedColumns
-
browseColumns
-
links
-
browseOrder
-
toDisplay
-
toDisplay
-
createMethod
-
createMethods
-
createMethodList
public static StoredObjectUtility.MethodList createMethodList(Class<?> objectClass, String attributeName) -
createMethodLists
public static StoredObjectUtility.MethodList[] createMethodLists(Class<?> objectClass, StringList attributeNames) -
execute
-
executeRaw
-
emptyValue
-
retrieveObject
Retrieve an instance of theStoredObject
from the value provided. The value may be anything including some representation of theId
or the object's stringified value from which it can be crated using its "get" method if it exists.- Type Parameters:
O
- Type of theStoredObject
.- Parameters:
objectClass
- Class of theStoredObject
.value
- Value to be converted.- Returns:
- The instance created or null if not convertible.
-
toString
-
toString
-
dump
public static <O extends StoredObject> StringBuilder dump(StoredObject object, StringBuilder buffer) -
getObjectClass
-
createLink
public static StoredObjectUtility.Link<?> createLink(Class<? extends StoredObject> masterClass, String linkDetails) -
linkDetails
public static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass) -
linkDetails
public static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass, StringList extraLinks) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, String extraCondition) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, String extraCondition) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, boolean any) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, String extraCondition, boolean any) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, boolean any) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, String extraCondition, boolean any) -
stackTrace
-
stackTrace
-
stackTrace
-
stackTrace
-
getTransactionLog
-
sameContent
public static boolean sameContent(TransactionManager tm, StoredObject one, StoredObject two) throws Exception - Throws:
Exception
-
changed
public static <T extends StoredObject> boolean changed(T newObject, T oldObject, StyledBuilder changes) -
createSQL
public static String createSQL(ClassAttribute<?> ca, String columns, String condition, String order, boolean only, boolean header, int skip, int limit, int[] distinct) Create a SQL execution string. (Can be used for debugging purposes).- Parameters:
ca
- Class attribute.columns
- Columns.condition
- Condition.order
- Order by clause.only
- Whether to use inherited instances or not.header
- Header to be used or not.skip
- Number of rows to be skipped before returning the results.limit
- Limit the number of rows.distinct
- Column numbers for the DISTINCT clause. An empty array is used to consider all the columns.- Returns:
- SQL string.
-