LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info
Class LyFilterRelation

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.LyInfo
          extended by leon.info.LyFilterRelation
All Implemented Interfaces:
java.lang.Cloneable, LyFilterElement, LyCommentInterface

public final class LyFilterRelation
extends LyInfo
implements LyFilterElement

The LyFilterRelation class implements the description of a filter used to filter objects list on a relation field.
A relation filter is defined by a relation field info and by a filter.

See also tag of leon.dtd

See Also:
LyFilter, LyFilterExpression

Nested Class Summary
 
Nested classes/interfaces inherited from class leon.info.LyTag
LyTag.Model
 
Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyFilterRelation()
          Constructor of a default relation filter.
LyFilterRelation(LyRelationFieldInfo fieldInfo)
          Constructor of a relation filter with a given field info.
LyFilterRelation(LyRelationFieldInfo fieldInfo, LyFilter filter)
          Constructor of an identified relation filter.
LyFilterRelation(java.lang.String id, LyRelationFieldInfo fieldInfo, LyFilter filter)
          Constructor of an identified relation filter.
 
Method Summary
 void addAcceptedTargetClassInfo(LyClassInfo targetClassInfo)
          (Optional, used by the application) Add a possible target classInfo to the list.
 LyFilterRelation cloneFilterRelation()
          Clone this relation filter.
 boolean contains(LyFieldInfo fieldInfo)
          Checks if an expression is found concerning the given field info.
 java.lang.String dump()
          Dumps current relation filter as a String.
 LyClassInfo getAcceptedTargetClassInfos(int index)
          Optional info : In order to OPTIMIZE database select, get the accepted target class.
 int getAcceptedTargetCount()
          Optional info : In order to OPTIMIZE database select, indicate the number of classes which are the accepted as target classes.
 LyClassInfo getClassInfo()
          Gets the classInfo on which this relation filter applies.
 LyInfoList<LyFieldInfo> getFieldInfos()
          Gets list of fieldInfos that this filter refers to.
 LyFilter getFilter()
          Get the filter from this relation filter.
 java.lang.String getName()
          Returns a displayable string of this element.
 LyInfoList<LyClassInfo> getPossibleClasses(boolean notAbstract)
          Returns the list of class infos on which the relation filter may be applied.
 LyRelationFieldInfo getRelationFieldInfo()
          Gets the fieldInfo on which this relation filter applies.
 void lock()
          Lock this relation filter.
 boolean match(LyValueSet values)
          Check if the specified values matches current relation filter.
 boolean match(java.lang.Object object)
          Check if the specified object matches current filter.
 void setClassInfo(LyClassInfo classInfo)
          Sets the classInfo on which this expression applies.
 void setFilter(LyFilter filter)
          Sets the filter to this relation filter.
 void setRelationFieldInfo(LyRelationFieldInfo fieldInfo)
          Sets the fieldInfo on which this expression applies.
 void writeXml(java.io.PrintWriter pw)
          Writes XML corresponding to this relation filter element.
 
Methods inherited from class leon.info.LyInfo
getAlias, getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setApplication, setFile, toString
 
Methods inherited from class leon.info.LyTag
clone, 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.parser.LyCommentInterface
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyFilterRelation

public LyFilterRelation(java.lang.String id,
                        LyRelationFieldInfo fieldInfo,
                        LyFilter filter)
Constructor of an identified relation filter.

Parameters:
id - The identifier of the object.
fieldInfo - Relation FieldInfo on which this filter expression applies.
filter - Filter used for this relation filter.

LyFilterRelation

public LyFilterRelation(LyRelationFieldInfo fieldInfo,
                        LyFilter filter)
Constructor of an identified relation filter.

Parameters:
fieldInfo - Relation FieldInfo on which this filter expression applies.
filter - Filter used for this relation filter.

LyFilterRelation

public LyFilterRelation(LyRelationFieldInfo fieldInfo)
Constructor of a relation filter with a given field info.

Parameters:
fieldInfo - FieldInfo on which this filter expression applies.

LyFilterRelation

public LyFilterRelation()
Constructor of a default relation filter.

Method Detail

match

public boolean match(java.lang.Object object)
Check if the specified object matches current filter.

Specified by:
match in interface LyFilterElement
Parameters:
object - Object to check.
Returns:
True if the object matches filter criteria, false otherwise.
See Also:
LyFilterElement.match(java.lang.Object)

match

public boolean match(LyValueSet values)
Check if the specified values matches current relation filter.

Specified by:
match in interface LyFilterElement
Parameters:
values - Values to check.
Returns:
True if the object matches filter criteria, false otherwise.
See Also:
LyFilterElement.match(java.lang.Object)

lock

public void lock()
Lock this relation filter.


cloneFilterRelation

public LyFilterRelation cloneFilterRelation()
Clone this relation filter.


dump

public java.lang.String dump()
Dumps current relation filter as a String.

Returns:
String representation of this relation filter.

writeXml

public void writeXml(java.io.PrintWriter pw)
Writes XML corresponding to this relation filter element.

Specified by:
writeXml in interface LyFilterElement
Parameters:
pw - PrintWriter on which the XML is written.

getName

public java.lang.String getName()
Returns a displayable string of this element.

Specified by:
getName in interface LyFilterElement
Overrides:
getName in class LyInfo
Returns:
A displayable string representation of this element.

contains

public boolean contains(LyFieldInfo fieldInfo)
Checks if an expression is found concerning the given field info.

Parameters:
fieldInfo - The fieldInfo.
Returns:
True if an expression with the specified is found, false otherwise.

getRelationFieldInfo

public LyRelationFieldInfo getRelationFieldInfo()
Gets the fieldInfo on which this relation filter applies.

Returns:
RelationFieldInfo concerned by this relation filter.

getClassInfo

public LyClassInfo getClassInfo()
Gets the classInfo on which this relation filter applies.

Returns:
ClassInfo concerned by this relation filter.

getFilter

public LyFilter getFilter()
Get the filter from this relation filter.

Returns:
Filter of this relation filter.

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos()
Gets list of fieldInfos that this filter refers to.

Returns:
List of fieldInfos that the filter depends on.

getPossibleClasses

public LyInfoList<LyClassInfo> getPossibleClasses(boolean notAbstract)
Returns the list of class infos on which the relation filter may be applied.

Parameters:
notAbstract - Specifies if the search classInfos must be only concrete classes or not.
Returns:
the list of class infos on which the relation filter may be applied

setRelationFieldInfo

public void setRelationFieldInfo(LyRelationFieldInfo fieldInfo)
Sets the fieldInfo on which this expression applies.

Parameters:
fieldInfo - FieldInfo concerned by this filter expression.

setFilter

public void setFilter(LyFilter filter)
Sets the filter to this relation filter.

Parameters:
filter - Filter to set to this relation filter.

setClassInfo

public void setClassInfo(LyClassInfo classInfo)
Sets the classInfo on which this expression applies.

Parameters:
classInfo - ClassInfo concerned by this filter expression.

addAcceptedTargetClassInfo

public void addAcceptedTargetClassInfo(LyClassInfo targetClassInfo)
(Optional, used by the application) Add a possible target classInfo to the list. If specified, the filter will apply ONLY in target classInfos

Parameters:
classInfo - target classInfo to look for filtering

getAcceptedTargetClassInfos

public LyClassInfo getAcceptedTargetClassInfos(int index)
Optional info : In order to OPTIMIZE database select, get the accepted target class. Content is set by the application to avoid searching in useless possible classes.

Parameters:
index - index of the classInfo
Returns:
target classInfos to look for filtering

getAcceptedTargetCount

public int getAcceptedTargetCount()
Optional info : In order to OPTIMIZE database select, indicate the number of classes which are the accepted as target classes. Content is set by the application to avoid searching in useless possible classes.

Returns:
the count of targetClassInfos

(c) January 2013 - W4 S.A.

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