com.webmethods.caf.faces.data.dir
Class PrincipalAttributeValueSource

java.lang.Object
  extended by com.webmethods.caf.faces.data.dir.PrincipalAttributeValueSource
All Implemented Interfaces:
Serializable

public class PrincipalAttributeValueSource
extends Object
implements Serializable

Wrapper Object around a principal attribute value source. Contains the attribute provider URI and the attribute name.

Since:
7.0
See Also:
Serialized Form

Field Summary
protected  String attrName
           
protected  IThingID providerURI
           
protected  String providerURIStr
           
static char SEPARATOR_CHAR
          The separator character used to spit the provider URI from the attribute name.
 
Constructor Summary
PrincipalAttributeValueSource()
          Default constructor creates an empty value source.
PrincipalAttributeValueSource(IThingID providerURI, String attrName)
          Constructor set the provider URI, provider URI string, and attribute name.
PrincipalAttributeValueSource(String rawValueString)
          Constructor creates a provider URI and attribute name from the string value.
 
Method Summary
 boolean equals(Object obj)
          Is this object equal to the one passed in.
 String getAttrName()
          Get the attribute name.
 IThingID getProviderURI()
          Get the provider URI.
 String getProviderURIStr()
          Get the provider URI string.
 int hashCode()
          Create a hash code from the provider URI, URI string value, and the attribute name.
 void setAttrName(String attrName)
          Set the attribute name.
 void setProviderURI(IThingID providerURI)
          Set the provider URI.
 void setProviderURIStr(String providerURIStr)
          Set the provider URI string.
 String toString()
          Create a string value from the from the provider URI and the attribute name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR_CHAR

public static final char SEPARATOR_CHAR

The separator character used to spit the provider URI from the attribute name.

See Also:
Constant Field Values

providerURI

protected IThingID providerURI

providerURIStr

protected String providerURIStr

attrName

protected String attrName
Constructor Detail

PrincipalAttributeValueSource

public PrincipalAttributeValueSource()
Default constructor creates an empty value source. Provider URI, URI string, and attribute name are null.


PrincipalAttributeValueSource

public PrincipalAttributeValueSource(String rawValueString)
Constructor creates a provider URI and attribute name from the string value. The string value is checked for a SEPARATOR_CHAR. If the character is present then the first part is used a the value for the provider URI string and the second part is used for the attribute name. Otherwise the string is use for the provider URI string.

Parameters:
rawValueString - A character separated value for the provider URI String and attribute name.

PrincipalAttributeValueSource

public PrincipalAttributeValueSource(IThingID providerURI,
                                     String attrName)
Constructor set the provider URI, provider URI string, and attribute name. The provider URI string is set from the provider URI. Passing in a null value for provider URI will set the provider URI and URI string to null.

Parameters:
providerURI - The provider URI.
attrName - The attribute name.
Method Detail

getAttrName

public String getAttrName()
Get the attribute name.

Returns:
The attribute name.

setAttrName

public void setAttrName(String attrName)
Set the attribute name.

Parameters:
attrName - The attribute name to set.

getProviderURI

public IThingID getProviderURI()
Get the provider URI. If the provider URI is not set then try the provider URI string instead.

Returns:
The providerURI.
Throws:
RuntimeException

setProviderURI

public void setProviderURI(IThingID providerURI)
Set the provider URI. Set the provider URI string to the string value of providerURI.

Parameters:
providerURI - The providerURI to set.

getProviderURIStr

public String getProviderURIStr()
Get the provider URI string.

Returns:
The providerURIStr

setProviderURIStr

public void setProviderURIStr(String providerURIStr)
Set the provider URI string. If a null or empty value is passed in the provider URI string is set to null. Set the provider URI to null.

Parameters:
providerURIStr - The providerURIStr to set.

toString

public String toString()
Create a string value from the from the provider URI and the attribute name. Return a empty string if the provider URI and the attribute name are empty.

Overrides:
toString in class Object
Returns:
A string value for this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Create a hash code from the provider URI, URI string value, and the attribute name.

Overrides:
hashCode in class Object
Returns:
Hash code for this object.
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Is this object equal to the one passed in.

Overrides:
equals in class Object
Parameters:
obj - The object to compare to.
Returns:
True, if the same object or the value source and attribute are equal. Otherwise false.
See Also:
Object.equals(java.lang.Object)