Class AssociationFieldDefinition


  • public class AssociationFieldDefinition
    extends FieldDefinition
    An association field definition that can represent a source->target association or a target->source association.
    Author:
    Gavin Cornwell
    • Field Detail

      • endpointType

        protected java.lang.String endpointType
      • 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:
        endpointMany - true if multiple targets can be selected
      • toString

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