Package com.storedobject.core
Class ClassAttribute<T extends StoredObject>
java.lang.Object
com.storedobject.core.ClassAttribute<T>
- Type Parameters:
T- Class type.
Class attribute of a
StoredObject class contains metadata information about the class that is not
applicable to normal Java classes. Metadata information is used for determining the behavior of the
object instances when displayed it on the screen, stored in the database etc.- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a list of column names that can be browsed, taking into account metadata restrictions such as secret fields.Retrieves the browse order.Retrieves the list of display columns.Method[]Get the "file" methods of this.static ClassAttribute<?> get(int family) Get the class attribute instance for the given family (eachStoredObjectclass has a unique family code).static <O extends StoredObject>
ClassAttribute<O> Get the class attribute instance for the given object class.static <O extends StoredObject>
ClassAttribute<O> get(O object) Get the class attribute instance for the given object instance.Retrieves the action prefix.Get all attributes that can be used by end-developers (for reporting/displaying etc.)Get anchors defined for this.Get the list of attributes.Get extra fields of this.intRetrieves the family identifier.getFieldMetadata(String fieldName) Get the UI field metadata for a given attribute name.getFieldMetadata(String fieldName, boolean external) Get the UI field metadata for a given attribute name.Get the "form layout" information of this.intGet the "form style" of this.Get the "get" method for the given attribute.Get the module name.Class of this.Get the parent of this.Get the table name.getTitle()Get the "title" of this.inthints()inthowBig(boolean any) Get an indication about how big this database table is.links()listChildClasses(boolean fullTree) Get the list of child classes of this.static StringmoduleName(Class<? extends StoredObject> objectClass) Retrieves the list of protected column names.Retrieves the list of search columns to be used in the application.Get the "set" method for the given attribute.intstatusUI()static StringtableName(Class<? extends StoredObject> objectClass) booleanwriteAllowed(String attributeName) Whether write is allowed for the given attribute or not.
-
Method Details
-
writeAllowed
Whether write is allowed for the given attribute or not.- Parameters:
attributeName- Name of the attribute.- Returns:
- True/false.
-
getFieldMetadata
Get the UI field metadata for a given attribute name.- Parameters:
fieldName- Name of the attribute.- Returns:
- UI field metadata.
-
getFieldMetadata
Get the UI field metadata for a given attribute name.- Parameters:
fieldName- Name of the attribute.external- True for considering externally defined metadata.- Returns:
- UI field metadata.
-
getAllAttributes
-
getMethod
-
setMethod
-
fileMethods
Get the "file" methods of this. File methods are those "get" methods that returnStreamDataorFileDatainstances.- Returns:
- Array of file methods.
-
getAttributes
-
getModuleName
-
getTableName
-
getObjectClass
-
listChildClasses
-
getExtraInfo
-
getParent
Get the parent of this.- Returns:
- Parent if nay. Otherwise, null is returned.
-
getFormStyle
public int getFormStyle()Get the "form style" of this. For internal use only.- Returns:
- Form style.
-
getTitle
-
getFormLayout
Get the "form layout" information of this. For internal use only.- Returns:
- Form layout information.
-
getExtraFields
Get extra fields of this. For internal use only.- Returns:
- List of extra fields.
-
howBig
public int howBig(boolean any) Get an indication about how big this database table is. For internal use only.- Parameters:
any- Whether to check the subclasses or not.- Returns:
- Hint about how big the database table is.
-
getAnchors
-
get
Get the class attribute instance for the given family (eachStoredObjectclass has a unique family code).- Parameters:
family- Family of the class.- Returns:
- Class attribute instance or null if it doesn't exit.
-
get
Get the class attribute instance for the given object instance.- Parameters:
object- Object instance.- Returns:
- Class attribute instance or null if it doesn't exit.
-
get
Get the class attribute instance for the given object class.- Parameters:
objectClass- Object class.- Returns:
- Class attribute instance or null if it doesn't exit.
-
tableName
-
moduleName
-
getFamily
public int getFamily()Retrieves the family identifier.- Returns:
- the family identifier as an integer.
-
getActionPrefix
Retrieves the action prefix. If the action prefix is explicitly set and non-empty, it is returned. Otherwise, it attempts to invoke the static and public method `actionPrefixForUI` from the associated class to determine the value. If no valid action prefix is determined, it defaults to null.- Returns:
- the action prefix as a non-empty string, or null if no valid prefix is available.
-
displayColumns
Retrieves the list of display columns.- Returns:
- A list of display column names as a StringList.
-
searchColumns
Retrieves the list of search columns to be used in the application.- Returns:
- A list of search columns after determining and sanitizing the appropriate values.
-
protectedColumns
Retrieves the list of protected column names. If there are no protected columns, it returns an empty list.- Returns:
- a
StringListcontaining protected column names, or an emptyStringListif none exist.
-
browseColumns
Retrieves a list of column names that can be browsed, taking into account metadata restrictions such as secret fields. The method ensures that sensitive or secret fields are excluded from the result. If no display columns are defined, it defaults to returning a list containing "Id".- Returns:
- A `StringList` representing the columns available for browsing.
-
browseOrder
-
links
-
hints
public int hints() -
statusUI
public int statusUI()
-