org.alfresco.repo.forms
Class AssociationFieldDefinition

java.lang.Object
  extended by org.alfresco.repo.forms.FieldDefinition
      extended by org.alfresco.repo.forms.AssociationFieldDefinition

public class AssociationFieldDefinition
extends FieldDefinition

An association field definition that can represent a source->target association or a target->source association.


Nested Class Summary
static class AssociationFieldDefinition.Direction
           
 
Field Summary
protected  AssociationFieldDefinition.Direction endpointDirection
           
protected  boolean endpointMandatory
           
protected  boolean endpointMany
           
protected  java.lang.String endpointType
           
 
Fields inherited from class org.alfresco.repo.forms.FieldDefinition
binding, dataKeyName, defaultValue, description, group, label, name, protectedField
 
Constructor Summary
AssociationFieldDefinition(java.lang.String name, java.lang.String endpointType, AssociationFieldDefinition.Direction endpointDirection)
          Default constructor
 
Method Summary
 AssociationFieldDefinition.Direction getEndpointDirection()
          Returns the direction the association is going.
 java.lang.String getEndpointType()
          Returns the type of the target of the association
 boolean isEndpointMandatory()
          Determines whether the target is mandatory
 boolean isEndpointMany()
          Determines if multiple targets can be selected
 void setEndpointMandatory(boolean endpointMandatory)
          Sets whether the target is mandatory
 void setEndpointMany(boolean endpointMany)
          Sets whether multiple targets can be selected
 java.lang.String toString()
           
 
Methods inherited from class org.alfresco.repo.forms.FieldDefinition
getBinding, getDataKeyName, getDefaultValue, getDescription, getGroup, getLabel, getName, isProtectedField, setBinding, setDataKeyName, setDefaultValue, setDescription, setGroup, setLabel, setProtectedField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

endpointType

protected java.lang.String endpointType

endpointDirection

protected AssociationFieldDefinition.Direction endpointDirection

endpointMandatory

protected boolean endpointMandatory

endpointMany

protected boolean endpointMany
Constructor Detail

AssociationFieldDefinition

public AssociationFieldDefinition(java.lang.String name,
                                  java.lang.String endpointType,
                                  AssociationFieldDefinition.Direction endpointDirection)
Default constructor

Parameters:
name - The name of the association
endpointType - The type of the item at the end of the association
endpointDirection - The direction the association is going
Method Detail

getEndpointType

public java.lang.String getEndpointType()
Returns the type of the target of the association

Returns:
The type of the target

getEndpointDirection

public AssociationFieldDefinition.Direction getEndpointDirection()
Returns the direction the association is going.

Direction.TARGET means the endpoint is the target and the field is the source.

Direction.SOURCE means the endpoint is the source and the field is the target.

Returns:
Direction.TARGET or Direction.SOURCE

isEndpointMandatory

public boolean isEndpointMandatory()
Determines whether the target is mandatory

Returns:
true if a target has to be selected

setEndpointMandatory

public void setEndpointMandatory(boolean endpointMandatory)
Sets whether the target is mandatory

Parameters:
endpointMandatory - true if a target has to be selected

isEndpointMany

public boolean isEndpointMany()
Determines if multiple targets can be selected

Returns:
true if multiple targets can be selected

setEndpointMany

public void setEndpointMany(boolean endpointMany)
Sets whether multiple targets can be selected

Parameters:
targetMany - true if multiple targets can be selected

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.