com.sas.entities
Class AttributeSetException

com.sas.entities.AttributeSetException
All Implemented Interfaces:
java.io.Serializable

public class AttributeSetException

An AttributeSetException is thrown when an assignment to an Entity's attribute fails. Attribute assignment can fail because the value does not satisfy validation constraints.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
AttributeSetException()
          Create a default AttributeSetException instance.
AttributeSetException(java.lang.Object entity, java.lang.String attributeName, java.lang.Object value, java.lang.String bundleName, java.lang.String resourceName, java.lang.Object[] args, java.lang.ClassLoader classLoader)
          Construct an AttributeSetException using the elements necessary to render the exception under different locales.
AttributeSetException(java.lang.String message)
          Create an AttributeSetException instance with a default message.
AttributeSetException(java.lang.String bundleName, java.lang.String resourceName, java.lang.Object[] args, java.lang.ClassLoader classLoader)
          Construct an AttributeSetException using the elements necessary to render the exception under different locales.
 
Method Summary
 java.lang.String getAttributeName()
          Return the name of the attribute for which attribute assigment failed.
 java.lang.Object getEntity()
          Return the Entity for which the attribute assignment failed.
 java.lang.Object getValue()
          Return the value that failed assignment to an attribute.
 void setAttributeName(java.lang.String _attributeName)
          Set the name of the attribute for which attribute assigment failed.
 void setEntity(java.lang.Object _entity)
          Set the Entity for which the attribute assignment failed.
 void setMessage(java.lang.Object entity, java.lang.String attributeName, java.lang.Object value, java.lang.String bundleName, java.lang.String resourceName, java.lang.Object[] args, java.lang.ClassLoader classLoader)
          Set the elements of a localizable message.
 void setValue(java.lang.Object _value)
          Save the value that failed assignment to an attribute.
 

Constructor Detail

AttributeSetException

public AttributeSetException()
Create a default AttributeSetException instance. If you use this constructor, you should set all the properties necessary for making a localizable message, using setMessage(Object entity, String attributeName, Object value, String bundleName, String resourceName, Object[] args, ClassLoader classLoader) Consider using AttributeSetException(Object entity, String attributeName, Object value, String bundleName, String resourceName, Object[] args, ClassLoader classLoader) instead.


AttributeSetException

public AttributeSetException(java.lang.String message)
Create an AttributeSetException instance with a default message. If you use this constructor, you should set all the properties necessary for making a localizable message, using setMessage(Object entity, String attributeName, Object value, String bundleName, String resourceName, Object[] args, ClassLoader classLoader) Consider using AttributeSetException(Object entity, String attributeName, Object value, String bundleName, String resourceName, Object[] args, ClassLoader classLoader) instead.


AttributeSetException

public AttributeSetException(java.lang.String bundleName,
                             java.lang.String resourceName,
                             java.lang.Object[] args,
                             java.lang.ClassLoader classLoader)
Construct an AttributeSetException using the elements necessary to render the exception under different locales.

Parameters:
bundleName - the name of a resource bundle, such as "com.sas.text.Resources"
resourceName - The name of a resource within the resource bundle
args - An array of arguments which are formatted using MessageFormat and the message obtained from the resourceName
classLoader - The class loader of the class from which the resource bundle is loaded. Normally, this is the instantiating class' class loader. Since the client which formats the exception may reside in a different class loader, it may not be able to find the correct resource bundle. This class loader allows this AttributeSetException to find the correct resource bundle.

AttributeSetException

public AttributeSetException(java.lang.Object entity,
                             java.lang.String attributeName,
                             java.lang.Object value,
                             java.lang.String bundleName,
                             java.lang.String resourceName,
                             java.lang.Object[] args,
                             java.lang.ClassLoader classLoader)
Construct an AttributeSetException using the elements necessary to render the exception under different locales.

Parameters:
entity - the object for which the attribute assignment failed
attributeName - the name of the attribute which was the target of the assignment
value - the value that was being set on the attribute
bundleName - the name of a resource bundle, such as "com.sas.text.Resources"
resourceName - The name of a resource within the resource bundle.
args - An array of arguments which are formatted using MessageFormat and the message obtained from the resourceName
classLoader - The class loader of the class from which the resource bundle is loaded. Normally, this is the instantiating class' class loader. Since the client which formats the exception may reside in a different class loader, it may not be able to find the correct resource bundle. This class loader allows this AttributeSetException to find the correct resource bundle.
Method Detail

getEntity

public java.lang.Object getEntity()
Return the Entity for which the attribute assignment failed.

Returns:
the object for which the attribute assignment failed

setEntity

public void setEntity(java.lang.Object _entity)
Set the Entity for which the attribute assignment failed.

Parameters:
_entity - the object for which the attribute assignment failed

getValue

public java.lang.Object getValue()
Return the value that failed assignment to an attribute.

Returns:
the value that was being set on the attribute

setValue

public void setValue(java.lang.Object _value)
Save the value that failed assignment to an attribute.

Parameters:
_value - the value that was being set on the attribute

getAttributeName

public java.lang.String getAttributeName()
Return the name of the attribute for which attribute assigment failed.

Returns:
the name of the attribute which was the target of the assignment

setAttributeName

public void setAttributeName(java.lang.String _attributeName)
Set the name of the attribute for which attribute assigment failed.

Parameters:
_attributeName - the name of the attribute which was the target of the assignment

setMessage

public void setMessage(java.lang.Object entity,
                       java.lang.String attributeName,
                       java.lang.Object value,
                       java.lang.String bundleName,
                       java.lang.String resourceName,
                       java.lang.Object[] args,
                       java.lang.ClassLoader classLoader)
Set the elements of a localizable message.

Parameters:
entity - the object for which the attribute assignment failed
attributeName - the name of the attribute which was the target of the assignment
value - the value that was being set on the attribute
bundleName - the name of a resource bundle
resourceName - the name of the resource from the bundle
args - the arguments to pass to a MessageFormat object



Copyright © 2009 SAS Institute Inc. All Rights Reserved.