LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info
Class LyClassInfo

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.LyInfo
          extended by leon.info.LyObjectInfo
              extended by leon.info.LyClassInfo
All Implemented Interfaces:
java.lang.Cloneable, LyClass, LyCommentInterface

public class LyClassInfo
extends LyObjectInfo
implements LyClass

The instances of this class provide a description of an application class.

Instances of LyClassInfo are a memory representation of the information read from the data description file.
The data description file (XML) is read at startup : for each tag tag found, the application creates a new instance of LyClassInfo to store the information from the XML file in a memory representation. This information is used during execution by the control package to offer some generic processing.

Instances of LyClassInfo offer the following services :

See Also:
LyFieldInfo, LyAction, LyFilter, LyClassBehavior, LyCache

Nested Class Summary
 
Nested classes/interfaces inherited from class leon.info.LyTag
LyTag.Model
 
Field Summary
static java.lang.String __version
           
static boolean ALLOW_NON_ABSTRACT_INHERITED_CLASS
           
static int MARK_LOAD
          Mark : Load this class on launch.
static int MARK_LOCAL
          Mark : To specify that the class is local (no physical representation).
 
Fields inherited from class leon.info.LyObjectInfo
__VERSION, NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL
 
Fields inherited from interface leon.data.LyClass
__VERSION
 
Constructor Summary
LyClassInfo(LyClassInfo template, boolean local)
          Constructs a temporary class info for internal data processings from a given class info template.
LyClassInfo(LyClassInfo template, java.lang.String binding, java.lang.String location, boolean local, boolean cloneStruct, boolean keepJavaName, boolean keepBehavior, int parts)
          Constructs a temporary class info for internal data processings from a given class info template.
LyClassInfo(LyClassInfo template, java.lang.String binding, java.lang.String location, boolean local, boolean cloneStruct, int parts)
          Constructs a temporary class info for internal data processings from a given class info template.
LyClassInfo(LyClassInfo template, java.lang.String binding, java.lang.String location, boolean local, int parts)
          Constructs a temporary class info for internal data processings from a given class info template.
 
Method Summary
 java.lang.String checkJavaName(java.lang.String javaName)
          check javaName attribute, replace points with underscore.
 void clearObjectSourceCache()
          Internal use to clear the objectsource cache when the object source has changed.
 boolean contains(LyAction action)
          Checks if the given action is contained in this classInfo.
 boolean contains(LyFieldInfo fieldInfo)
          Checks if the given fieldInfo is contained in this classInfo.
 LyValueSet copy(java.lang.Object object1, java.lang.Object object2)
          This method does nothing on a classInfo but it has to be present and public because this method is defined in the LyClass interface and LyClassInfo implements this interface.
 LyObject createInstance()
          Creates a new instance of this class.
 void free()
          Free a class info.
 boolean fromArray()
          Checks if this classInfo results from an array definition.
 boolean fromStruct()
          Checks if this classInfo results from a struct definition.
 LyAction getAction(int index)
          Fetches the action at the specified index in actions list.
 LyAction getAction(java.lang.String id)
          Fetches the action with the specified identifier.
 int getActionCount()
          Returns the number of action supported on this classInfo.
 LyInfoList<LyAction> getActions()
          Returns the set of actions available on this class info.
 LyInfoList<LyAction> getActions(java.util.BitSet marks, boolean matchAll)
          Fetches the list of actions which match (one or all of) the specified marks.
 LyInfoList<LyAction> getActions(int mark)
          Fetches the list of actions that match the specified mark.
 LyInfoList<LyAction> getActions(int mark, boolean not)
          Fetches the list of actions that match (or not match) the specified mark.
 LyInfoList<LyAction> getActionsWithId(java.lang.String actionId)
          Indicates if this class info has at least one action of the given "type".
 LyAction getActionWithId(java.lang.String actionId)
          Indicates if this class info has at least one action of the given "type".
 java.lang.Class<?> getBehaviorClass()
          Gets behavior class.
 java.lang.String getBehaviorClassName()
          Gets behavior class name.
 LyClassBinding getBinding()
          Gets the binding information.
 LyInfoCache getCachePolicy()
          Gets cache policy for this class info.
 LyControl getControl(int index)
          Fetches the control at the specified index.
 int getControlCount()
          Return the number of controls associated to this class.
 LyInfoList<LyControl> getControls()
          Returns the set of controls defined on this class info.
 LyDataSource getDataSource()
          Gets data source for this class.
 LyAction getDefaultAction()
          Retrieve the default action for this classInfo.
 java.lang.String getDefaultJavaName()
          Gets default java class name corresponding to this class info.
 LyField getField(java.lang.String id)
          Retrieves a field (field info) by its id.
 LyFieldInfo getFieldInfo(int index)
          Returns the fieldInfo at the specified index in fields list.
 LyFieldInfo getFieldInfo(java.lang.String id)
          Search the fieldInfo with the given identifier.
 LyFieldInfo getFieldInfo(java.lang.String id, boolean exception)
          Search the fieldInfo with the given identifier.
 int getFieldInfoCount()
          Returns the number of fieldInfos for this classInfo.
 LyInfoList<LyFieldInfo> getfieldInfoFromBinding(java.lang.String binding)
          Find fieldinfos from the peer value (connector value defined in class binding).
 LyInfoList<LyFieldInfo> getFieldInfos()
          Gets list of field infos of this class info.
 LyInfoList<LyFieldInfo> getFieldInfos(java.util.BitSet marks)
          Gets a list of fieldInfos that match the given marks.
 LyInfoList<LyFieldInfo> getFieldInfos(java.util.BitSet marks, boolean matchAll)
          Gets list of fieldInfo that match one or all of the given marks.
 LyInfoList<LyFieldInfo> getFieldInfos(int mark)
          Gets a list of fieldInfos that match the given mark.
 java.util.Vector<LyFieldInfo> getFields()
          Gets list of fields (field infos) of this class.
 java.util.BitSet getGenericMarks()
          Accessor to the generic marks attached to this instance.
 java.lang.reflect.Method getGetMethod(LyFieldInfo fieldInfo)
          Returns get method for the given fieldInfo.
 LyInfoList<LyFieldInfo> getIdFieldInfos()
          Gets id field infos (field infos that have MARK_ID).
 java.util.Vector<LyFieldInfo> getIdFields()
          Gets id fields (field infos that identify instances of this class).
 int getIndex(LyFieldInfo fieldInfo)
          Gets index for the given fielInfo.
 java.lang.String getJavaName()
          Gets java class name corresponding to this class info when java code generation is used.
 LyInfoLabel getLabel(int index)
          Returns the label of this classInfo at the given index.
 LyInfoLabel getLabel(LyInfoLabel.Type type)
          Returns the label of this classInfo for the specified type.
 int getLabelCount()
          Returns the number of labels of this classInfo.
 LyInfoLabel[] getLabels()
          Returns all labels of this classInfo.
static int getMark(java.lang.String markName)
          Gets mark index corresponding to the given mark name.
static int getMark(java.lang.String markName, boolean add)
          Gets mark index corresponding to the given mark name.
static java.lang.String getMarkName(int markIndex)
          Get mark name for the given index of a mark.
static java.util.BitSet getMarks(java.util.BitSet marks, int parts)
          Accessor to the marks attached to this instance (presented as a bitset).
 LyInfoList<LyFieldInfo> getNameFieldInfos()
          Gets name field infos (field infos that have MARK_NAME).
 int getNextCount()
          Gets the next value of the internal counter.
 java.lang.Class<?> getObjectClass()
          Gets physical class used to store physical instances of this application class.
 LyObjectId getObjectId(java.lang.Object object)
          Gets objectId of a given object.
 LyObjectSource getObjectSource()
          Returns object source corresponding to this class info.
 LyClass getPeerClass()
          Gets peer class of this class info.
 java.util.List<LyPeerDataProvider> getPeerDataProviders()
          Find the connectors for a classinfo Usually there is only one connector but some classes may have multiples (with unions) or none if not bound to any datasource
 LyAction getRealAction(LyAction action)
          Searchs on this class for an action that "inherits" of the given action.
 LyClassInfo getRealClass()
          Returns the real class corresponding to this class info.
 LyFieldInfo getRealFieldInfo(LyFieldInfo fieldInfo)
          Method to check the given field info and return in some cases the real field info.
 LyFieldInfo getRealFieldInfo(LyFieldInfo fieldInfo, boolean exception)
          Internal method to check the given field info and return in some cases the real field info.
 LyRoute getRoute(int index)
          Fetches the route at the specified index.
 LyRoute getRoute(java.lang.String id)
          Fetches the route with the specified id.
 LyInfoList<LyRoute> getRoutes()
          Returns the set of routes defined on this class info.
 LyInfoList<LyRoute> getRoutes(LyClassInfo classInfo)
          Returns a set of routes between this class info and the specified class.
 int getRoutesCount()
          Return the number of routes in the class.
 LyRule getRule(short index)
          Gets a rule from the rules list at a given position.
 short getRuleCount()
          Gets rules count.
 LyInfoList<LyRule> getRules()
          Returns the list of rules defined on this class info.
 java.lang.reflect.Method getSetMethod(LyFieldInfo fieldInfo)
          Returns set method for the given fieldInfo.
 LySort getSort()
          Gets default sort for this classInfo.
 java.lang.String[] getSpecificMarks()
          Accessor to the marks attached to this instance (presented as an array of strings).
 LyInfoList<LyClassInfo> getSubClasses()
          Gets the list of sub-classes.
 LyInfoList<LyClassInfo> getSubClasses(boolean godown)
          Gets the list of sub-classes.
 LyClassInfo getSuperClass()
          Returns the super class of this class info.
 java.lang.String getTip()
          Retuns the tip (short help displayed in tool tip) associated to this instance.
 LyInfoLabel getUserLabel(int i)
          Returns the user label at the given position.
 LyInfoLabel getUserLabel(java.lang.String subType)
          Returns the user label for the given subType.
 int getUserLabelCount()
          Returns the number of labels of this classInfo.
 java.lang.Object getValue(java.lang.Object object, LyField field)
          Gets value of an object on a given field (field info).
 LyValueSet getValues(java.lang.Object object)
          Gets values set for the given object.
 LyFieldInfo getVirtualFieldInfo(LyFieldInfo fieldInfo)
          Returns the field info corresponding to given one in this class info.
 boolean inheritsFrom(LyClassInfo classInfo)
          Checks if this class info inherits from the given one.
 boolean isAbstract()
          Checks if this class info is abstract or not.
 boolean isDerivated(LyFieldInfo fieldInfo)
          Checks if the given field info is derivated : the field info was defined on the super-class or its template.
 boolean isInherited(LyFieldInfo fieldInfo)
          Checks if the given field info is inherited : the field info was defined on the super-class.
 boolean isLocal()
          Tests if the class is local (whether it has the mark MARK_LOCAL or not).
 boolean isNameDifferentOfId()
          Check if this class info has object names : if object name and object id are different for instances of this class info.
 boolean isNamePartOfId()
          Check if for class info, the name is sub-part of the id.
 boolean isTemporary()
          Checks if this class is temporary (dynamic built).
 boolean isVirtual()
          Checks if this class info is virtual or not.
 java.lang.Object newInstance()
          Creates a new instance of this class.
 void rehash(java.lang.Object object)
          Recompute the object id of the specified object.
 void resetFieldIndexes()
          Reset the internal table of indexes used to speed up fieldInfo accesses.
 void setApplication(LyApplication application)
          Sets the application for this info.
 void setCachePolicy(LyInfoCache cache)
          Sets cache policy.
 void setCheckFieldInsertion(boolean checkFieldInsertion)
          Sets the _checkFieldInsertion parameter.
 void setValue(java.lang.Object object, LyField field, java.lang.Object value)
          Sets value of an object on a given field (field info).
 
Methods inherited from class leon.info.LyObjectInfo
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getUserData, hasMark, hasMarks, hasTemplate, isTemplate, putData, putData, removeData, toName
 
Methods inherited from class leon.info.LyInfo
getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setFile, toString
 
Methods inherited from class leon.info.LyTag
getCommentsEnd, getCommentsStart, getEnvironment, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.data.LyClass
getId, getName
 
Methods inherited from interface leon.parser.LyCommentInterface
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart
 

Field Detail

__version

public static final java.lang.String __version
See Also:
Constant Field Values

MARK_LOCAL

public static final int MARK_LOCAL
Mark : To specify that the class is local (no physical representation).

See Also:
Constant Field Values

MARK_LOAD

public static final int MARK_LOAD
Mark : Load this class on launch.

See Also:
Constant Field Values

ALLOW_NON_ABSTRACT_INHERITED_CLASS

public static boolean ALLOW_NON_ABSTRACT_INHERITED_CLASS
Constructor Detail

LyClassInfo

public LyClassInfo(LyClassInfo template,
                   boolean local)
Constructs a temporary class info for internal data processings from a given class info template.

Parameters:
template - Reference of a class template used to initialize this new instance.
local - Boolean indicating if the class info should be local or not.

LyClassInfo

public LyClassInfo(LyClassInfo template,
                   java.lang.String binding,
                   java.lang.String location,
                   boolean local,
                   int parts)
Constructs a temporary class info for internal data processings from a given class info template.

Parameters:
template - Reference of a class template used to initialize this new instance.
binding - Binding of this temporary class info.
location - Location of the binding.
local - Boolean indicating if the class info should be local or not.

LyClassInfo

public LyClassInfo(LyClassInfo template,
                   java.lang.String binding,
                   java.lang.String location,
                   boolean local,
                   boolean cloneStruct,
                   int parts)
Constructs a temporary class info for internal data processings from a given class info template.

Parameters:
template - Reference of a class template used to initialize this new instance.
binding - Binding of this temporary class info.
location - Location of the binding.
local - Boolean indicating if the class info should be local or not.
cloneStruct - Boolean indicating if the structFields must be cloned.

LyClassInfo

public LyClassInfo(LyClassInfo template,
                   java.lang.String binding,
                   java.lang.String location,
                   boolean local,
                   boolean cloneStruct,
                   boolean keepJavaName,
                   boolean keepBehavior,
                   int parts)
Constructs a temporary class info for internal data processings from a given class info template.

Parameters:
template - Reference of a class template used to initialize this new instance.
binding - Binding of this temporary class info.
location - Location of the binding.
local - Boolean indicating if the class info should be local or not.
cloneStruct - Boolean indicating if the structFields must be cloned.
keepJavaName - Boolean indicating if the javaname must be kept.
keepBehavior - Boolean indicating if the behavior must be kept.
Method Detail

getMark

public static int getMark(java.lang.String markName,
                          boolean add)
Gets mark index corresponding to the given mark name.

Parameters:
markName - Mark name.
add - indicates if the.mark must be added if it doesn't exit
Returns:
Mark value.

getMark

public static int getMark(java.lang.String markName)
Gets mark index corresponding to the given mark name.

Parameters:
markName - Mark name.
Returns:
Mark value.

getMarkName

public static java.lang.String getMarkName(int markIndex)
Get mark name for the given index of a mark.

Parameters:
markIndex - Index of the mark.
Returns:
Mark name.

free

public void free()
Free a class info. Only a temporary class info can be freed.

Throws:
java.lang.IllegalStateException - If this class info is not temporary.

getObjectClass

public java.lang.Class<?> getObjectClass()
Gets physical class used to store physical instances of this application class.

Specified by:
getObjectClass in interface LyClass
Returns:
The physical Java class (as specified by javaName attribute or LyObject.class if javaName is not set, or if the class corresponding to this name can't be found). For a classInfo, getObjectClass should return a class that extends LyObject.

getDataSource

public LyDataSource getDataSource()
Gets data source for this class.

Specified by:
getDataSource in interface LyClass
Returns:
The data source for this class. For a class info, the data source is in fact an instance of LyObjetSource.

getIdFields

public java.util.Vector<LyFieldInfo> getIdFields()
Gets id fields (field infos that identify instances of this class).

Specified by:
getIdFields in interface LyClass
Returns:
Vector of id. fields. Normally, can't be null since a class with no id field is not accepted.

getFields

public java.util.Vector<LyFieldInfo> getFields()
Gets list of fields (field infos) of this class.

Specified by:
getFields in interface LyClass
Returns:
Vector of fields (field infos). Normally, can't be null since a class with no field is not accepted.

getField

public LyField getField(java.lang.String id)
Retrieves a field (field info) by its id.

Specified by:
getField in interface LyClass
Parameters:
id - Id of the searched field.
Returns:
Field with the given id if found, null otherwise.

getObjectId

public LyObjectId getObjectId(java.lang.Object object)
Gets objectId of a given object.

Specified by:
getObjectId in interface LyClass
Parameters:
object - Object for which an objectId is requested.
Returns:
ObjectId of the given object.

getValue

public java.lang.Object getValue(java.lang.Object object,
                                 LyField field)
Gets value of an object on a given field (field info).

Specified by:
getValue in interface LyClass
Parameters:
object - Object instance of this class.
field - Field on which a value is asked.
Returns:
The corresponding value of the object for the given field.

setValue

public void setValue(java.lang.Object object,
                     LyField field,
                     java.lang.Object value)
Sets value of an object on a given field (field info).

Specified by:
setValue in interface LyClass
Parameters:
object - Object instance of this class.
field - Field on which the value is set.
value - Value to set on the object for the given field.

getValues

public LyValueSet getValues(java.lang.Object object)
Gets values set for the given object.

Specified by:
getValues in interface LyClass
Parameters:
object - Object on which values are requested.
Returns:
List of values for the given object.

copy

public LyValueSet copy(java.lang.Object object1,
                       java.lang.Object object2)
This method does nothing on a classInfo but it has to be present and public because this method is defined in the LyClass interface and LyClassInfo implements this interface.

Specified by:
copy in interface LyClass
Parameters:
object1 - Object that receives values of object2.
object2 - Object to copy.
Returns:
This method always returns null.
See Also:
LyClass

newInstance

public java.lang.Object newInstance()
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException
Creates a new instance of this class.

Specified by:
newInstance in interface LyClass
Returns:
A logical instance of this class (physical instance of the class returned by getObjectClass method, that should be a subclass of LyObject).
Throws:
java.lang.InstantiationException - If an application tries to instantiate an abstract class or an interface, or if the instantiation fails for some other reason.
java.lang.IllegalAccessException - If the class or initializer is not accessible.

createInstance

public LyObject createInstance()
Creates a new instance of this class. Same as newInstance but catching exceptions and returning a LyObject.

Returns:
A logical instance of this class (physical instance of the class returned by getObjectClass method, that should be a subclass of LyObject).

inheritsFrom

public boolean inheritsFrom(LyClassInfo classInfo)
Checks if this class info inherits from the given one.

Parameters:
classInfo - Checked class info
Returns:
True if this class info inherits from the given one, false otherwise.

isAbstract

public boolean isAbstract()
Checks if this class info is abstract or not. A class info is considered as abstract if it has at least one sub class.

Returns:
True if this class info is abstract, false otherwise.

isVirtual

public boolean isVirtual()
Checks if this class info is virtual or not.

Returns:
True if this class info is virtual, false otherwise.

isInherited

public boolean isInherited(LyFieldInfo fieldInfo)
Checks if the given field info is inherited : the field info was defined on the super-class.

Parameters:
fieldInfo - Checked field info
Returns:
True if the field info is inherited, false otherwise.

isDerivated

public boolean isDerivated(LyFieldInfo fieldInfo)
Checks if the given field info is derivated : the field info was defined on the super-class or its template.

Parameters:
fieldInfo - Checked field info
Returns:
True if the field info is derivated, false otherwise.

isTemporary

public boolean isTemporary()
Checks if this class is temporary (dynamic built).


getSuperClass

public LyClassInfo getSuperClass()
Returns the super class of this class info.

Returns:
Super class of this class info, null otherwise.

getSubClasses

public LyInfoList<LyClassInfo> getSubClasses()
Gets the list of sub-classes.

Returns:
Info list that contains the sub-classes of this class info, null if this class info is not abstract.

getSubClasses

public LyInfoList<LyClassInfo> getSubClasses(boolean godown)
Gets the list of sub-classes.

Parameters:
godown - indicates if the sub-classes are searched recursivly.
Returns:
Info list that contains the sub-classes of this class info, null if this class info is not abstract.

getObjectSource

public LyObjectSource getObjectSource()
Returns object source corresponding to this class info.

Returns:
The object source of this class info.

clearObjectSourceCache

public void clearObjectSourceCache()
Internal use to clear the objectsource cache when the object source has changed. The objectsource will be computed again from the application next time getObjectSource() is called.

See Also:
getObjectSource()

getJavaName

public java.lang.String getJavaName()
Gets java class name corresponding to this class info when java code generation is used.

Returns:
Name of the java class corresponding to this classInfo. By default, if no java name is set, this method returns the id of this class info.

getDefaultJavaName

public final java.lang.String getDefaultJavaName()
Gets default java class name corresponding to this class info.

Returns:
Name of the default java class corresponding to this classInfo.

checkJavaName

public java.lang.String checkJavaName(java.lang.String javaName)
check javaName attribute, replace points with underscore.

Returns:
new javaName

getBehaviorClassName

public java.lang.String getBehaviorClassName()
Gets behavior class name.

Returns:
Java name of behavior class (may be null).

getBehaviorClass

public java.lang.Class<?> getBehaviorClass()
Gets behavior class. Class that defines behavior required for this class info for main actions (consult, create, clone, set, delete).

Returns:
Behavior class for this class info (may be null).

getGetMethod

public java.lang.reflect.Method getGetMethod(LyFieldInfo fieldInfo)
Returns get method for the given fieldInfo. This method will be called by reflection.

Parameters:
fieldInfo - Field info for which the get method is requested.
Returns:
The get method corresponding to the given field info (can be null).

getSetMethod

public java.lang.reflect.Method getSetMethod(LyFieldInfo fieldInfo)
Returns set method for the given fieldInfo. This method will be called by reflection.

Parameters:
fieldInfo - Field info for which the set method is requested.
Returns:
The set method corresponding to the given field info (can be null).

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos()
Gets list of field infos of this class info.

Returns:
List of field infos, can't be null since a class info with no fields is not accepted.

getIdFieldInfos

public LyInfoList<LyFieldInfo> getIdFieldInfos()
Gets id field infos (field infos that have MARK_ID).

Returns:
List of id field infos, can't be null since a class info with no id fields is not accepted.

getNameFieldInfos

public LyInfoList<LyFieldInfo> getNameFieldInfos()
Gets name field infos (field infos that have MARK_NAME).

Returns:
List of name field infos, can't be null since a class info with no name fields use the id fields as name fields.

getFieldInfo

public LyFieldInfo getFieldInfo(java.lang.String id,
                                boolean exception)
Search the fieldInfo with the given identifier.

Parameters:
id - Identifier of the fieldInfo
exception - Boolean indicating if an exception is thrown if not found.
Returns:
The fieldInfo corresponding to the given id if found, or null if not found and the parameter exception is set to false.
Throws:
java.lang.IllegalStateException - if the fieldInfo corresponding to the given id was not found in this classInfo and if the parameter exception is set to true.

getFieldInfo

public LyFieldInfo getFieldInfo(java.lang.String id)
Search the fieldInfo with the given identifier. This method calls getFieldInfo(id, true).

Parameters:
id - Identifier of the fieldInfo
Returns:
The fieldInfo corresponding to the given id if found.
Throws:
java.lang.IllegalStateException - if the fieldInfo corresponding to the given id was not found in this classInfo.
See Also:
getFieldInfo(String, boolean)

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos(java.util.BitSet marks)
Gets a list of fieldInfos that match the given marks.

Parameters:
marks - Requested marks for result fieldInfos.
Returns:
List of field infos that match the marks, an empty list if no field info has these marks.

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos(int mark)
Gets a list of fieldInfos that match the given mark.

Parameters:
mark - Requested mark for result fieldInfos.
Returns:
List of field infos that match the given mark, an empty list if no field info has this mark.

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos(java.util.BitSet marks,
                                             boolean matchAll)
Gets list of fieldInfo that match one or all of the given marks.

Parameters:
marks - Requested marks, or null for the entire fieldInfo list.
matchAll - Indicates if the fieldIndo must have at least one mark (false) or all of them (true). Any fieldInfo that match a mark from the mark list is returned if matchAll is false.
Returns:
The set of requested fieldInfos, an empty vector if no result is found.

getAction

public LyAction getAction(java.lang.String id)
Fetches the action with the specified identifier.

Parameters:
id - Identifier of the requested action
Returns:
The action identified by this id, or null if it could not be found.

getActions

public LyInfoList<LyAction> getActions(java.util.BitSet marks,
                                       boolean matchAll)
Fetches the list of actions which match (one or all of) the specified marks.

Parameters:
marks - The requested marks.
matchAll - Indicates if the action must have at least one mark ('false') or all of them ('true').
Returns:
List of the requested actions, or an empty list if no action has these marks.

getActions

public LyInfoList<LyAction> getActions(int mark,
                                       boolean not)
Fetches the list of actions that match (or not match) the specified mark.

Parameters:
mark - The requested mark.
not - To invert the search : if this parameter is set to 'true', the searched action are those that don't have the given mark.
Returns:
List of the requested actions, or an empty list if no action have this mark (or if all have it if not is set to 'true').

getActions

public LyInfoList<LyAction> getActions(int mark)
Fetches the list of actions that match the specified mark.

Parameters:
mark - The requested mark.
Returns:
List of the requested actions, or an empty list if no action have this mark.

getDefaultAction

public LyAction getDefaultAction()
Retrieve the default action for this classInfo. The default action is the first action specified on this class info with the DEFAULT mark or the first action of the classInfo if no action has this mark.

Returns:
Default action for this classInfo.

getActionWithId

public LyAction getActionWithId(java.lang.String actionId)
Indicates if this class info has at least one action of the given "type". This means that an action of the class info has the given id or has a template action ancestor that has this id. This method is used to check if a type of action (for example, consultation) is enabled on this class.

Parameters:
actionId - Action identifier that is tested on this class.
Returns:
The action that inherits an action whose id is the given parameter, null otherwise.

getActionsWithId

public LyInfoList<LyAction> getActionsWithId(java.lang.String actionId)
Indicates if this class info has at least one action of the given "type". This means that an action of the class info has the given id or has a template action ancestor that has this id. This method is used to check if a type of action (for example, consultation) is enabled on this class.

Parameters:
actionId - Action identifier that is tested on this class.
Returns:
The actions that inherits an action whose id is the given parameter, null otherwise.

getRealAction

public LyAction getRealAction(LyAction action)
Searchs on this class for an action that "inherits" of the given action.

Parameters:
action - Searched action.
Returns:
The action that inherits the given action on this class, null if not found.

getBinding

public LyClassBinding getBinding()
Gets the binding information. Generic or specific data providers use the binding information to fetch data from and to a data provider.

Returns:
Binding information for this class info.

getCachePolicy

public LyInfoCache getCachePolicy()
Gets cache policy for this class info. The cache policy determines how objects are loaded and unloaded in memory.

Returns:
Informations about the cache policy chosen for this class. Caches are built by reflection from this informations.

isLocal

public boolean isLocal()
Tests if the class is local (whether it has the mark MARK_LOCAL or not).

Returns:
True if this class is local, false otherwise.

getPeerClass

public final LyClass getPeerClass()
Gets peer class of this class info. The peer class represents how "physical objects" are handled.

Returns:
Returns peer class of this class info.

getSort

public LySort getSort()
Gets default sort for this classInfo.

Returns:
Default sort for this classInfo (may be null).

getFieldInfo

public LyFieldInfo getFieldInfo(int index)
Returns the fieldInfo at the specified index in fields list.

Parameters:
index - Index of the requested fieldInfo
Returns:
The searched fieldInfo if it exists, or null if not found.

getIndex

public int getIndex(LyFieldInfo fieldInfo)
Gets index for the given fielInfo.

Returns:
Index of the field info in field infos list, 1 if this fieldInfo doesn't belong to this classInfo.

resetFieldIndexes

public void resetFieldIndexes()
Reset the internal table of indexes used to speed up fieldInfo accesses.


contains

public boolean contains(LyFieldInfo fieldInfo)
Checks if the given fieldInfo is contained in this classInfo.

Parameters:
fieldInfo - Checked fieldInfo.
Returns:
True if the given fieldInfo is found, false otherwise.

getRealFieldInfo

public LyFieldInfo getRealFieldInfo(LyFieldInfo fieldInfo)
Method to check the given field info and return in some cases the real field info.


getRealFieldInfo

public LyFieldInfo getRealFieldInfo(LyFieldInfo fieldInfo,
                                    boolean exception)
Internal method to check the given field info and return in some cases the real field info.


getFieldInfoCount

public int getFieldInfoCount()
Returns the number of fieldInfos for this classInfo.

Returns:
Number of fieldInfos for this class.

getAction

public LyAction getAction(int index)
Fetches the action at the specified index in actions list.

Parameters:
index - Index of the searched action.
Returns:
Action at the given index if it's found, null if it's not found.

getActionCount

public int getActionCount()
Returns the number of action supported on this classInfo.

Returns:
Number of actions on this classInfo.

getActions

public LyInfoList<LyAction> getActions()
Returns the set of actions available on this class info.

Returns:
Actions available on this class info, or an empty list.

contains

public boolean contains(LyAction action)
Checks if the given action is contained in this classInfo.

Parameters:
action - Action that is searched on this classInfo.
Returns:
True if the given action is found, false otherwise.

getRoutesCount

public int getRoutesCount()
Return the number of routes in the class.

Returns:
Number of routes in the class.

getRoute

public LyRoute getRoute(int index)
Fetches the route at the specified index.

Parameters:
index - Index of the searched route.
Returns:
The requested route if found, or null if it could not be found.

getRoute

public LyRoute getRoute(java.lang.String id)
Fetches the route with the specified id.

Parameters:
id - Id of the searched route.
Returns:
The requested route if found, or null if it could not be found.

getRoutes

public LyInfoList<LyRoute> getRoutes()
Returns the set of routes defined on this class info. This is a COPY of the internal list, therefore this list may be freely manipulated by the application.

Returns:
The set of routes, or an empty list.

getRoutes

public LyInfoList<LyRoute> getRoutes(LyClassInfo classInfo)
Returns a set of routes between this class info and the specified class. Routes are used to calculate cross references beetween two classes.

Parameters:
classInfo - Class info with which routes are searched.
Returns:
List of routes between this class info and the given class or null if there is no available route.

isNameDifferentOfId

public boolean isNameDifferentOfId()
Check if this class info has object names : if object name and object id are different for instances of this class info.

Returns:
True if they are different, false otherwise.

isNamePartOfId

public boolean isNamePartOfId()
Check if for class info, the name is sub-part of the id.

Returns:
True if name is included in id, false otherwise.

getControlCount

public int getControlCount()
Return the number of controls associated to this class.

Returns:
Number of controls of this class.

getControl

public LyControl getControl(int index)
Fetches the control at the specified index.

Parameters:
index - Index of the searched control.
Returns:
The requested control if found, or null if it could not be found.

getControls

public LyInfoList<LyControl> getControls()
Returns the set of controls defined on this class info. This is a COPY of the internal list, therefore this list may be freely manipulated by the application.

Returns:
The set of controls, or an empty list.

getRule

public LyRule getRule(short index)
Gets a rule from the rules list at a given position.

Parameters:
index - Position of the searched rule. If index is negative (-1) return null
Returns:
Rule at the given index if it exists.

getRuleCount

public short getRuleCount()
Gets rules count.

Returns:
Return the number of rules in this class info.

getRules

public LyInfoList<LyRule> getRules()
Returns the list of rules defined on this class info.

Returns:
List of rules, or null if no rule was registered on this class info.

fromStruct

public boolean fromStruct()
Checks if this classInfo results from a struct definition.

Returns:
True if this classInfo was created from a struct definition.

fromArray

public boolean fromArray()
Checks if this classInfo results from an array definition.

Returns:
True if this classInfo was created from an array definition.

getTip

public java.lang.String getTip()
Retuns the tip (short help displayed in tool tip) associated to this instance. Overridden to use labels instead of tip when defined.

Overrides:
getTip in class LyObjectInfo
Returns:
Tip of the instance, or null if no tip was defined.

getRealClass

public LyClassInfo getRealClass()
Returns the real class corresponding to this class info.

Returns:
The first non virtual ancestor of this class info.

getVirtualFieldInfo

public LyFieldInfo getVirtualFieldInfo(LyFieldInfo fieldInfo)
Returns the field info corresponding to given one in this class info.

Parameters:
fieldInfo - Real field info.
Returns:
The first virtual field info that has the given field info as template.

setCachePolicy

public void setCachePolicy(LyInfoCache cache)
Sets cache policy.

Parameters:
cache - Informations about the cache policy for this class.

setCheckFieldInsertion

public void setCheckFieldInsertion(boolean checkFieldInsertion)
Sets the _checkFieldInsertion parameter.

Parameters:
checkFieldInsertion - true if we must check the existence of the template when inserting a field info in current class info, false otherwise.

getLabelCount

public int getLabelCount()
Returns the number of labels of this classInfo.


getLabel

public LyInfoLabel getLabel(LyInfoLabel.Type type)
Returns the label of this classInfo for the specified type.


getLabel

public LyInfoLabel getLabel(int index)
Returns the label of this classInfo at the given index.


getUserLabelCount

public int getUserLabelCount()
Returns the number of labels of this classInfo.


getLabels

public LyInfoLabel[] getLabels()
Returns all labels of this classInfo.


getUserLabel

public LyInfoLabel getUserLabel(int i)
Returns the user label at the given position.


getUserLabel

public LyInfoLabel getUserLabel(java.lang.String subType)
Returns the user label for the given subType.


rehash

public void rehash(java.lang.Object object)
Recompute the object id of the specified object.

Specified by:
rehash in interface LyClass
Parameters:
object - object to rehash

setApplication

public void setApplication(LyApplication application)
Sets the application for this info. Once assigned, the application can be changed.

Overrides:
setApplication in class LyInfo
Parameters:
application - The application to which the info belongs.
Throws:
java.lang.IllegalStateException - If the info already belongs to an application.

getNextCount

public int getNextCount()
Gets the next value of the internal counter.

Returns:
The next available value of the counter.

getMarks

public static java.util.BitSet getMarks(java.util.BitSet marks,
                                        int parts)
Accessor to the marks attached to this instance (presented as a bitset).

Returns:
A copy of the bitset which represents the marks (properties) of this instance.
See Also:
BitSet

getfieldInfoFromBinding

public LyInfoList<LyFieldInfo> getfieldInfoFromBinding(java.lang.String binding)
Find fieldinfos from the peer value (connector value defined in class binding). Since multiple fields may be bound to the same data source binding, this method may return a list.

Parameters:
binding - the binding to search
Returns:
the requested fieldInfos, an empty list if none is found or null if parameter is null

getPeerDataProviders

public java.util.List<LyPeerDataProvider> getPeerDataProviders()
Find the connectors for a classinfo Usually there is only one connector but some classes may have multiples (with unions) or none if not bound to any datasource

Returns:
the list of peer providers

getGenericMarks

public java.util.BitSet getGenericMarks()
Accessor to the generic marks attached to this instance.


getSpecificMarks

public java.lang.String[] getSpecificMarks()
Accessor to the marks attached to this instance (presented as an array of strings).


(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com