atg.markers
Class ValidateMarkerByPossibleValue

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.markers.ValidateMarkerByPossibleValue
All Implemented Interfaces:
MarkerValidator, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
ConfigurableMarkerValidator

public abstract class ValidateMarkerByPossibleValue
extends GenericService
implements MarkerValidator

This abstraction defines a marker validator that valdiates by ensuring the new marker's value is valid with the new marker's key.

The following options can be configured.
1. Accept all values as valid by setting acceptAllValues to true.
2. Accept only specific values as valid by setting nullValueValid to false and returning valid values from getValidValuesForKey.
3. Accept only a null value as valid by setting nullValueValid to true and returning null from getValidValuesForKey.
4. Accept null and specific values as valid by setting nullValueValid to true and returning valid values from getValidValuesForKey.

See Also:
isAcceptAllValues(), isNullValueValid(), getValidValuesForKey(java.lang.String)

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  boolean mAcceptAllValues
           
protected  boolean mNullValueValid
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ValidateMarkerByPossibleValue()
           
 
Method Summary
abstract  java.util.List getValidValuesForKey(java.lang.String pMarkerKey)
          This method should return the possible marker values for the the provided marker key.
 boolean isAcceptAllValues()
          Boolean property for determining if all marker values are valid.
 boolean isNullValueValid()
          Boolean property for determining if a marker value of null is valid.
 boolean isValidMarker(RepositoryMarkerManager pRepositoryMarkerManager, RepositoryItem pMarkedItem, RepositoryItem pMarkerToValidate)
          This method determines if a marker is considered valid.
 boolean isValidValueForKey(java.lang.String pKey, java.lang.String pValue)
          Determines if the value is valid for the key
 void setAcceptAllValues(boolean pAcceptAllValues)
          Sets the boolean property for determining if all marker values are valid.
 void setNullValueValid(boolean pNullValueValid)
          Sets the boolean property for determining if the marker value is allowed to be null.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mNullValueValid

protected boolean mNullValueValid

mAcceptAllValues

protected boolean mAcceptAllValues
Constructor Detail

ValidateMarkerByPossibleValue

public ValidateMarkerByPossibleValue()
Method Detail

isValidMarker

public boolean isValidMarker(RepositoryMarkerManager pRepositoryMarkerManager,
                             RepositoryItem pMarkedItem,
                             RepositoryItem pMarkerToValidate)
                      throws MarkerException
This method determines if a marker is considered valid.

Specified by:
isValidMarker in interface MarkerValidator
Parameters:
pRepositoryMarkerManager - the marker manager making the validation request
pMarkedItem - the item being marked
pMarkerToValidate - the marker to validate
Returns:
true if marker is valid
Throws:
MarkerException

getValidValuesForKey

public abstract java.util.List getValidValuesForKey(java.lang.String pMarkerKey)
This method should return the possible marker values for the the provided marker key.

Parameters:
pMarkerKey - the marker key
Returns:
List the possible valid values for the provided marker key.

isNullValueValid

public boolean isNullValueValid()
Boolean property for determining if a marker value of null is valid.

Returns:
true if a marker value of null is valid

setNullValueValid

public void setNullValueValid(boolean pNullValueValid)
Sets the boolean property for determining if the marker value is allowed to be null.


isAcceptAllValues

public boolean isAcceptAllValues()
Boolean property for determining if all marker values are valid.

Returns:
true if all marker values are valid

setAcceptAllValues

public void setAcceptAllValues(boolean pAcceptAllValues)
Sets the boolean property for determining if all marker values are valid.


isValidValueForKey

public boolean isValidValueForKey(java.lang.String pKey,
                                  java.lang.String pValue)
Determines if the value is valid for the key

Returns:
true if the value is valid