com.novell.nds.dirxml.shimhost
Class SchemaDef.AttrDef

java.lang.Object
  extended bycom.novell.nds.dirxml.shimhost.SchemaDef.AttrDef
All Implemented Interfaces:
ConfigElement
Enclosing class:
SchemaDef

public static class SchemaDef.AttrDef
extends Object
implements ConfigElement

Class encapsulating a DirXML <attr-def> schema definition.


Method Summary
 String getASN1ID()
          Return the ASN1 ID for the attribute, if any.
static int getAttrTypeFromString(String typeString)
          Get the integer value corresponding to a value from the "type" attribute.
static String getAttrTypeString(int type)
          Get the String corresponding to an integer "type" value.
 boolean getCaseSensitive()
          Get the value for the "case-sensitive" attribute.
 boolean getMultiValued()
          Get the value for the "multi-valued" attribute.
 String getName()
          Return the name of the attribute.
 boolean getNaming()
          Get the value for the "naming" attribute.
 boolean getReadOnly()
          Get the value for the "read-only" attribute.
 boolean getRequired()
          Get the value for the "required" attribute.
 int getType()
          Get the integer value corresponding to the "type" attribute.
 boolean hasBeenModified()
          Return true if this instance has been modified.
 void resetModified()
          Reset the modified flag for this instance such that hasBeenModified() will return false.
 void setASN1ID(String asn1id)
          Set the ASN1 ID for the attribute.
 void setCaseSensitive(boolean value)
          Set the value for the "case-sensitive" attribute.
 void setMultiValued(boolean value)
          Set the value for the "multi-valued" attribute.
 void setNaming(boolean value)
          Set the value for the "naming" attribute.
 void setReadOnly(boolean value)
          Set the value for the "read-only" attribute.
 void setRequired(boolean value)
          Set the value for the "required" attribute.
 void setType(int type)
          Set the integer value corresponding to the "type" attribute.
 Element toXML(Node parent)
          Create an XML representation for this instance under the passed Node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Return the name of the attribute.

Returns:
attribute name

getASN1ID

public String getASN1ID()
Return the ASN1 ID for the attribute, if any.

Returns:
ASN1 ID or null

setASN1ID

public void setASN1ID(String asn1id)
Set the ASN1 ID for the attribute.

Parameters:
asn1id - ID, or null

getCaseSensitive

public boolean getCaseSensitive()
Get the value for the "case-sensitive" attribute.

Returns:
true or false

setCaseSensitive

public void setCaseSensitive(boolean value)
Set the value for the "case-sensitive" attribute.

Parameters:
value - true or false

getMultiValued

public boolean getMultiValued()
Get the value for the "multi-valued" attribute.

Returns:
true or false

setMultiValued

public void setMultiValued(boolean value)
Set the value for the "multi-valued" attribute.

Parameters:
value - true or false

getNaming

public boolean getNaming()
Get the value for the "naming" attribute.

Returns:
true or false

setNaming

public void setNaming(boolean value)
Set the value for the "naming" attribute.

Parameters:
value - true or false

getReadOnly

public boolean getReadOnly()
Get the value for the "read-only" attribute.

Returns:
true or false

setReadOnly

public void setReadOnly(boolean value)
Set the value for the "read-only" attribute.

Parameters:
value - true or false

getRequired

public boolean getRequired()
Get the value for the "required" attribute.

Returns:
true or false

setRequired

public void setRequired(boolean value)
Set the value for the "required" attribute.

Parameters:
value - true or false

getType

public int getType()
Get the integer value corresponding to the "type" attribute.

Returns:
ATTR_TYPE_STRING, ATTR_TYPE_INT, etc.

setType

public void setType(int type)
             throws IllegalArgumentException
Set the integer value corresponding to the "type" attribute.

Parameters:
type - ATTR_TYPE_STRING, ATTR_TYPE_INT, etc.
Throws:
IllegalArgumentException - thrown if type parameter is incorrect

getAttrTypeFromString

public static int getAttrTypeFromString(String typeString)
                                 throws IllegalArgumentException
Get the integer value corresponding to a value from the "type" attribute.

Parameters:
typeString - value from "type" attribute
Returns:
ATTR_TYPE_STRING, ATTR_TYPE_INT, etc.
Throws:
IllegalArgumentException - thrown if typeString parameter is incorrect

getAttrTypeString

public static String getAttrTypeString(int type)
                                throws IllegalArgumentException
Get the String corresponding to an integer "type" value.

Parameters:
type - ATTR_TYPE_STRING, ATTR_TYPE_INT, etc.
Returns:
"string", "int", etc.
Throws:
IllegalArgumentException - thrown if type parameter is incorrect

hasBeenModified

public boolean hasBeenModified()
Return true if this instance has been modified.

The instance is considered to have been modified if a change was made that affects the persistent representation since:

  1. The instance was constructed from an XML representation.
  2. resetModified() was last called

Specified by:
hasBeenModified in interface ConfigElement
Returns:
true or false
See Also:
resetModified()

resetModified

public void resetModified()
Reset the modified flag for this instance such that hasBeenModified() will return false.

Specified by:
resetModified in interface ConfigElement
See Also:
hasBeenModified()

toXML

public Element toXML(Node parent)
Create an XML representation for this instance under the passed Node.

Note that the act of creating an XML representation does not reset this instance's modified flag. It must be reset by calling resetModified().

Specified by:
toXML in interface ConfigElement
Parameters:
parent - Node under which to construct XML representation.
Returns:
created Element
See Also:
hasBeenModified(), resetModified()