|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.info.LyTag
leon.info.LyInfo
leon.info.LyObjectInfo
leon.info.LyFieldInfo
leon.info.LyRelationFieldInfo
public class LyRelationFieldInfo
This class implements the description of relation fields. These fields represent relations between objects of an application.
A relation may be multiple, this means an object is related to several objects in the same time.
In that case, relations can be ordered when the order of values for a given relation field has a meaning (the same list with a different order is not the same value).
For a relation field, related objects are taken into the specified list of classes (instances of LyClassInfo) authorized on this field. An optional additional filter may be associated to each of these classes to filter objects proposed to end_user when he has to enter a value on a relation field.
Relations can be typed. The type determines the graphical representation of the relation.
Relation may also have a direction. This property is used to indicate under which conditions the relation is usable when calculating cross-references between objects of different classes. The supported values are defined as constants, named Direction.XXX.
Relation can have a default value. This default value can be either an object id given as a string or the name of a variable registered on the user session, in that last case, the value starts with a $.
Relations may also contains references to a "class field" and to a "context field". They are both used to restrict the number of objects proposed to the end-user when he has to enter values for the corresponding relation field. The class field refers to an other field of the same class that gives at one time the enabled class(es) for this relation. The context field refers to an other field of the same class that gives at one time a set of objects that is used to calculate via cross references the list of enabled objects for this relation.
Finally, local relations can be specified by a given set of routes that are used when calculating values for this field.
See also tag
LyClassInfo
,
LyFilter
,
LyRoute
,
LyRelationDaemon
Nested Class Summary | |
---|---|
static class |
LyRelationFieldInfo.Direction
Directions. |
static class |
LyRelationFieldInfo.ShowAs
Show as values. |
static class |
LyRelationFieldInfo.Type
Relation types. |
Nested classes/interfaces inherited from class leon.info.LyTag |
---|
LyTag.Model |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Fields inherited from class leon.info.LyObjectInfo |
---|
NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL |
Method Summary | |
---|---|
LyValue |
buildFieldValue(java.lang.Object value)
Builds the appropriate LyValue corresponding to this field for the given value object. |
java.lang.String |
checkValue(LyEnvironment environment,
java.lang.Object fieldValue)
Checks the given value : - the value must correspond to options of the choice. |
int |
compare(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Compares two objects for this fieldInfo. |
boolean |
contains(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Checks if the second value is contained in the first one, for this field. |
java.lang.String |
controlValue(LyEnvironment environment,
java.lang.Object fieldValue)
Controls the given value : - the number of values must be greater or equal to min, - the number of values must be lower or equal to max. |
boolean |
equals(java.lang.Object value1,
java.lang.Object value2,
java.util.BitSet modifiers)
Compares two objects for equality. |
java.util.Vector<LyClassRef> |
getClasses()
Returns the list of target classes available on this relation field. |
LyFieldInfo |
getClassField()
Gets the class field of this relation. |
LyClassInfo |
getClassInfo(int idx)
Retrieves the classInfo at the specified index associated to this relation field. |
int |
getClassInfoCount()
Gets number of class infos allowed for this relation. |
LyInfoDataList<LyClassInfo,LyFilter> |
getClassInfos()
Returns the list of target classes available on this relation field. |
LyRelationFieldInfo |
getContextField()
Gets the context field of this relation. |
LyInfoDaemon |
getDaemon()
Accessor of informations about the daemon to manage this relation. |
java.lang.String |
getDefault()
Return a string representation of the default value or null if no default is specified. |
java.lang.Object |
getDefaultValue()
Return the default value or null if no default is specified. |
LyRelationFieldInfo.Direction |
getDirection()
Gets the direction of the relation. |
LyRelationFieldInfo |
getExtendedRelation()
Returns the relation that is extended by this relation. |
LyFilter |
getFilter(int idx)
Retrieves the filter at the specified index. |
LyFilter |
getFilter(LyClassInfo classInfo)
Get filter associated to the given classInfo in this field. |
LyFilterExpression.Condition[] |
getFilterConditions()
Returns the filter conditions authorized on this field. |
LyInfoList<LyFilter> |
getFilters()
Retrieves all the filters associated to the classes of this relation, this is a COPY of the internal list. |
int |
getMax()
Gets the max number of accepted values for this field info. |
int |
getMin()
Gets the min number of required values for this field info. |
int |
getNCols()
Gets the preferred number of columns shown to the user at the same time. |
int |
getNRows()
Gets the preferred number of rows shown to the user at the same time. |
LySimpleObjectList |
getObjects(LyObject object)
Gets value of this field as an objects list for the given instance. |
LySimpleObjectList |
getObjects(java.lang.Object value)
Converts the given value of this field to an objects list. |
LyObjectId[] |
getOrderedIds(LyObjectId[] objectIds)
Sort list of object identifiers. |
java.lang.Object |
getPeerValue(java.lang.Object value,
java.lang.Class<?> objectClass,
LyObject instance)
Returns an object of the given class from a value of this fieldInfo. |
java.lang.Object[] |
getPeerValues(java.lang.Object value,
java.lang.Class<?>[] objectClasses,
LyObject instance)
Returns a table of objects for the given classes from a value of this fieldInfo. |
LyRelationFieldInfo |
getReverseRelation()
Returns the reverse relation of this relation. |
LyRoute |
getRoute(int index)
Gets the route at the specified index in routes list. |
LyRoute |
getRoute(java.lang.String id)
Gets the route with the specified id in routes list of this relation. |
LyInfoList<LyRoute> |
getRoutes()
Returns the set of routes available of this relation. |
int |
getRoutesCount()
Return the number of routes used to calculate values of this relation. |
LyRelationFieldInfo.ShowAs |
getShowAs()
Accessor for the showAs property. |
LyInfoList<LyRelationFieldInfo> |
getSubTypes()
Gets sub-types (list of relations). |
LyRelationFieldInfo.Type |
getType()
Accessor to the relation type. |
java.lang.Class<?> |
getValueClass()
Returns class of values for this field. |
java.lang.Object |
getValueFromObject(java.lang.Object object,
LyObject instance)
Constructs a value for this fieldInfo from an object for a given instance. |
boolean |
hasSubType(LyRelationFieldInfo relation)
Checks if the given relation is a sub-type of this relation. |
boolean |
ignoresContext()
Accessor to the noContext property. |
boolean |
inheritsFrom(LyRelationFieldInfo relation)
Checks if this relation inherits from the given one. |
boolean |
isAbstract()
Accessor to the abstract property. |
boolean |
isMultiple()
Accessor to the multiple property. |
boolean |
isOrdered()
Accessor to the ordered property. |
boolean |
isToolbarDisabled()
Accessor to the noToolbar property. |
java.lang.Object |
parse(java.lang.String stringValue)
Builds internal value for this field from a string (previously constructed by toString). |
boolean |
relatedWith(LyClassInfo classInfo)
Test if this relation has the specified classInfo in its related classes. |
java.lang.String |
toName(java.lang.Object fieldValue)
Returns the specified value for this field as a "displayable" string. |
java.lang.String |
toName(java.lang.Object fieldValue,
java.lang.String separator)
Returns the specified value for this field as a "displayable" string. |
java.lang.String |
toString(java.lang.Object fieldValue)
Converts the specified value for this field to an "internal" string (string that enables reconstruction through parse). |
Methods inherited from class leon.info.LyObjectInfo |
---|
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getTip, 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, setApplication, 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.LyField |
---|
getId |
Methods inherited from interface leon.parser.LyCommentInterface |
---|
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart |
Field Detail |
---|
public static final java.lang.String __VERSION
Method Detail |
---|
public java.lang.Class<?> getValueClass()
getValueClass
in interface LyField
getValueClass
in class LyFieldInfo
LyObject.getValue(leon.info.LyFieldInfo)
public LyValue buildFieldValue(java.lang.Object value)
buildFieldValue
in interface LyField
buildFieldValue
in class LyFieldInfo
value
- Value from which the LyValue is built.
LyRelationValue
public java.lang.Object parse(java.lang.String stringValue) throws LyFieldInfoFormatException
parse
in class LyFieldInfo
stringValue
- The value presented as a string as produced by the toString method.
LyFieldInfoFormatException
- If the string can't be parsed properly.toString(java.lang.Object)
public java.lang.String toName(java.lang.Object fieldValue)
toName
in class LyFieldInfo
LyFieldInfo.getValueClass()
public java.lang.String toName(java.lang.Object fieldValue, java.lang.String separator)
Object
- fieldValue : The fieldValue to display.String
- separator : The value of separator between field values.
public LyObjectId[] getOrderedIds(LyObjectId[] objectIds)
objectIds
- list of object identifiers to be sorted.
public java.lang.String toString(java.lang.Object fieldValue)
toString
in class LyFieldInfo
parse(java.lang.String)
public java.lang.String controlValue(LyEnvironment environment, java.lang.Object fieldValue)
controlValue
in class LyFieldInfo
environment
- Environment giving the user language if a message has to be produced.
LyFieldInfo.getValueClass()
public java.lang.String checkValue(LyEnvironment environment, java.lang.Object fieldValue)
checkValue
in class LyFieldInfo
environment
- Environment giving the user language if a message has to be produced.
LyFieldInfo.getValueClass()
public int compare(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
compare
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
LyFieldInfo.getValueClass()
public LyFilterExpression.Condition[] getFilterConditions()
getFilterConditions
in class LyFieldInfo
LyFilterExpression
public boolean equals(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
equals
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of LyFilterExpression).
LyFieldInfo.compare(java.lang.Object, java.lang.Object, java.util.BitSet)
,
LyFieldInfo.getValueClass()
public boolean contains(java.lang.Object value1, java.lang.Object value2, java.util.BitSet modifiers)
contains
in class LyFieldInfo
value1
- First value.value2
- Second value.modifiers
- Modifiers used for checking (see MOD_XXX constants of
LyFilterExpression).
public java.lang.Object getValueFromObject(java.lang.Object object, LyObject instance)
LyObjectId, String, Object | LyObjectId |
LyObjectId[], Object[], String[], Vector | LyObjectId[] |
getValueFromObject
in class LyFieldInfo
object
- The peer value.instance
- Instance containing the required value (could be null). This instance is
provided to be able to construct a value for complex bindings (bindings
involving other fields).
LyUnsupportedFieldBindingException
- If the given object can't be converted to a
value of this field.LyFieldInfo.getPeerValue(java.lang.Object, java.lang.Class>, leon.data.LyObject)
,
LyFieldBinding
public java.lang.Object getPeerValue(java.lang.Object value, java.lang.Class<?> objectClass, LyObject instance)
LyObjectId | LyObjectId, String |
LyObjectId[] | LyObjectId[], String[], Object[], Vector |
getPeerValue
in class LyFieldInfo
value
- Value of this fieldInfo. This value is an instance of the class
returned by getValueClass method.objectClass
- Expected class of the physical value.instance
- Instance containing the given value (could be null).
LyUnsupportedFieldBindingException
- If the requested conversion if none of the
supported conversions.LyFieldInfo.getValueClass()
public java.lang.Object[] getPeerValues(java.lang.Object value, java.lang.Class<?>[] objectClasses, LyObject instance)
getPeerValues
in class LyFieldInfo
value
- Value of this fieldInfo.objectClasses
- Expected classes of the physical values.instance
- Instance containing the given value (could be null).
LyUnsupportedFieldBindingException
- Thrown if we don't known how to build the peer
values from the given parameters.LyFieldInfo.getValueClass()
public LyRelationFieldInfo.Type getType()
public final LyRelationFieldInfo getExtendedRelation()
public boolean isAbstract()
public final boolean isMultiple()
isMultiple
in class LyFieldInfo
public final boolean isOrdered()
public final boolean ignoresContext()
public final boolean isToolbarDisabled()
public java.lang.Object getDefaultValue()
getDefaultValue
in class LyFieldInfo
getValueClass()
public java.lang.String getDefault()
public final LyRelationFieldInfo.Direction getDirection()
public final LyFieldInfo getClassField()
public final LyRelationFieldInfo getContextField()
public boolean relatedWith(LyClassInfo classInfo)
classInfo
- Class info to test.
public final LyClassInfo getClassInfo(int idx)
idx
- index of the requested classInfo.
public LyFilter getFilter(LyClassInfo classInfo)
classInfo
- ClassInfo for which we look for an associated filter.
public final LyFilter getFilter(int idx)
idx
- Index of the requested filter.
public final int getClassInfoCount()
public final java.util.Vector<LyClassRef> getClasses()
public final LyInfoDataList<LyClassInfo,LyFilter> getClassInfos()
public LyInfoList<LyFilter> getFilters()
public final int getRoutesCount()
public final LyRoute getRoute(int index)
index
- Index of the searched route.
public final LyRoute getRoute(java.lang.String id)
id
- Id of the searched route.
public final LyInfoList<LyRoute> getRoutes()
public final LyInfoDaemon getDaemon()
public final int getNRows()
public final int getNCols()
public final int getMin()
public final int getMax()
public final LyInfoList<LyRelationFieldInfo> getSubTypes()
public LySimpleObjectList getObjects(LyObject object)
object
- Instance for which the value is requested as an objects list.
public LySimpleObjectList getObjects(java.lang.Object value)
value
- Value to convert to an objects list. This value must be an instance of the
class given by getValueClass.
public LyRelationFieldInfo.ShowAs getShowAs()
public boolean inheritsFrom(LyRelationFieldInfo relation)
relation
- Checked relation.
public boolean hasSubType(LyRelationFieldInfo relation)
relation
- Sub type.
public final LyRelationFieldInfo getReverseRelation()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |