org.kuali.rice.kns.document.authorization
Class FieldRestriction

java.lang.Object
  extended by org.kuali.rice.kns.document.authorization.FieldRestriction

public class FieldRestriction
extends Object

This is a description of what this class does - zjzhou don't forget to fill this in.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
FieldRestriction()
          Constructs a FieldAuthorization.java.
FieldRestriction(String fieldName, boolean canEdit, boolean canView)
          Constructs a FieldAuthorization.java.
FieldRestriction(String fieldName, String fieldAuthorizationFlag)
          Constructs a FieldAuthorization.java.
 
Method Summary
 boolean equals(Object obj)
           
 String getFieldName()
          Gets the fieldName attribute.
 String getKualiFieldDisplayFlag()
          This method returns the correct flag from the Kuali Field object, that corresponds to the particular combination of editable and viewable set on this object.
 MaskFormatter getMaskFormatter()
           
 int hashCode()
           
 boolean isEditable()
          Gets the editable attribute.
 boolean isHidden()
          This method returns true if this authorization prohibits Viewing and Editing, resulting in a hidden field.
 boolean isMasked()
           
 boolean isPartiallyMasked()
           
 boolean isReadOnly()
          This method returns true if this authorization prohibits Editing but not Viewing, resulting in a ReadOnly field.
 boolean isRestricted()
          This method returns true if the FieldAuthorization is some kind of restriction, and returns false if it is an editable field.
 boolean isShouldBeEncrypted()
           
 boolean isViewable()
          Gets the viewable attribute.
 void setEditable(boolean editable)
          Sets the editable attribute value.
 void setFieldName(String fieldName)
          Sets the fieldName attribute value.
 void setMaskFormatter(MaskFormatter maskFormatter)
           
 void setShouldBeEncrypted(boolean shouldBeEncrypted)
           
 void setViewable(boolean viewable)
          Sets the viewable attribute value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldRestriction

public FieldRestriction()
Constructs a FieldAuthorization.java.


FieldRestriction

public FieldRestriction(String fieldName,
                        boolean canEdit,
                        boolean canView)
Constructs a FieldAuthorization.java.

Parameters:
fieldName - - name of field to represent
canEdit - - true if the field is editable in this context, false otherwise
canView - - true if thie field is viewable in this context, false otherwise

FieldRestriction

public FieldRestriction(String fieldName,
                        String fieldAuthorizationFlag)
Constructs a FieldAuthorization.java.

Parameters:
fieldName - - name of the field to represent
fieldAuthorizationFlag - - Field.HIDDEN, Field.READONLY, or Field.EDITABLE
Method Detail

getKualiFieldDisplayFlag

public String getKualiFieldDisplayFlag()
This method returns the correct flag from the Kuali Field object, that corresponds to the particular combination of editable and viewable set on this object.

Returns:
Field.HIDDEN, Field.READONLY, or Field.EDITABLE

isRestricted

public boolean isRestricted()
This method returns true if the FieldAuthorization is some kind of restriction, and returns false if it is an editable field.

Returns:
boolean

isHidden

public boolean isHidden()
This method returns true if this authorization prohibits Viewing and Editing, resulting in a hidden field.

Returns:
boolean

isReadOnly

public boolean isReadOnly()
This method returns true if this authorization prohibits Editing but not Viewing, resulting in a ReadOnly field.

Returns:
boolean

isEditable

public boolean isEditable()
Gets the editable attribute.

Returns:
Returns the editable.

setEditable

public void setEditable(boolean editable)
Sets the editable attribute value. Note that if editable is being set to true, and the internal value of viewable is false, viewable will be flipped to true, to avoid impossible combinations of flags.

Parameters:
editable - The editable to set.

getFieldName

public String getFieldName()
Gets the fieldName attribute.

Returns:
Returns the fieldName.

setFieldName

public void setFieldName(String fieldName)
Sets the fieldName attribute value.

Parameters:
fieldName - The fieldName to set.

isViewable

public boolean isViewable()
Gets the viewable attribute.

Returns:
Returns the viewable.

setViewable

public void setViewable(boolean viewable)
Sets the viewable attribute value. Note that if viewable is being set to false, and the internal value of editable is true, then editable will be silently flipped to false. This is done to avoid impossible combinations of authorization flags.

Parameters:
viewable - The viewable to set.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

isMasked

public boolean isMasked()
Returns:
the masked

isPartiallyMasked

public boolean isPartiallyMasked()
Returns:
the partiallyMasked

isShouldBeEncrypted

public boolean isShouldBeEncrypted()
Returns:
the shouldBeEncrypted

setShouldBeEncrypted

public void setShouldBeEncrypted(boolean shouldBeEncrypted)
Parameters:
shouldBeEncrypted - the shouldBeEncrypted to set

getMaskFormatter

public MaskFormatter getMaskFormatter()
Returns:
the maskFormatter

setMaskFormatter

public void setMaskFormatter(MaskFormatter maskFormatter)
Parameters:
maskFormatter - the maskFormatter to set


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.