public class SchemaDef extends java.lang.Object implements ConfigElement
| Modifier and Type | Class and Description |
|---|---|
static class |
SchemaDef.AttrDef
Class encapsulating a DirXML <attr-def> schema definition.
|
static class |
SchemaDef.ClassDef
Class encapsulating a DirXML <class-def> schema definition.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_APPLICATION_NAME
Name of the XML 'application-name' attribute.
|
static java.lang.String |
ATTR_ASN1ID
Name of the XML 'asn1id' attribute.
|
static java.lang.String |
ATTR_ATTR_NAME
Name of the XML 'attr-name' attribute.
|
static java.lang.String |
ATTR_CASE_SENSITIVE
Name of the XML 'case-sensitive' attribute.
|
static java.lang.String |
ATTR_CLASS_NAME
Name of the XML 'class-name' attribute.
|
static java.lang.String |
ATTR_CONTAINER
Name of the XML 'container' attribute.
|
static java.lang.String |
ATTR_DN_DELIMS
Name of the XML 'dn-delims' attribute.
|
static java.lang.String |
ATTR_DN_FORMAT
Name of the XML 'dn-format' attribute.
|
static java.lang.String |
ATTR_HIERARCHICAL
Name of the XML 'hierarchical' attribute.
|
static java.lang.String |
ATTR_MULTI_VALUED
Name of the XML 'multi-valued' attribute.
|
static java.lang.String |
ATTR_NAMING
Name of the XML 'naming' attribute.
|
static java.lang.String |
ATTR_READ_ONLY
Name of the XML 'read-only' attribute.
|
static java.lang.String |
ATTR_REQUIRED
Name of the XML 'required' attribute.
|
static java.lang.String |
ATTR_TYPE
Name of the XML 'type' attribute.
|
static int |
ATTR_TYPE_CLASSNAME
Constant representing the "className" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_COUNTER
Constant representing the "counter" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_DN
Constant representing the "dn" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_INT
Constant representing the "int" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_INTERVAL
Constant representing the "interval" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_OCTET
Constant representing the "octet" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_STATE
Constant representing the "state" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_STRING
Constant representing the "string" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_STRUCTURED
Constant representing the "structured" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_TELENUMBER
Constant representing the "teleNumber" value for the <attr-def> XML attribute "type".
|
static int |
ATTR_TYPE_TIME
Constant representing the "time" value for the <attr-def> XML attribute "type".
|
static int |
DN_FORMAT_DOT
Constant representing the "dot" value for the <schema-def> XML attribute "dn-format".
|
static int |
DN_FORMAT_LDAP
Constant representing the "slash" value for the <schema-def> XML attribute "dn-format".
|
static int |
DN_FORMAT_QUALIFIED_DOT
Constant representing the "qualified-dot" value for the <schema-def> XML attribute "dn-format".
|
static int |
DN_FORMAT_QUALIFIED_SLASH
Constant representing the "qualified-slash" value for the <schema-def> XML attribute "dn-format".
|
static int |
DN_FORMAT_SLASH
Constant representing the "slash" value for the <schema-def> XML attribute "dn-format".
|
static java.lang.String |
TAG_ATTR_DEF
Tag name of the <attr-def> element.
|
static java.lang.String |
TAG_CLASS_DEF
Tag name of the <class-def> element.
|
static java.lang.String |
TAG_SCHEMA_DEF
Tag name of the <schema-def> element.
|
static java.lang.String |
VAL_CLASSNAME
"className"
|
static java.lang.String |
VAL_COUNTER
"counter"
|
static java.lang.String |
VAL_DN
"dn"
|
static java.lang.String |
VAL_DOT
"dot"
|
static java.lang.String |
VAL_FALSE
"false"
|
static java.lang.String |
VAL_INT
"int"
|
static java.lang.String |
VAL_INTERVAL
"interval"
|
static java.lang.String |
VAL_LDAP
"ldap"
|
static java.lang.String |
VAL_OCTET
"octet"
|
static java.lang.String |
VAL_QUALIFIED_DOT
"qualified-dot"
|
static java.lang.String |
VAL_QUALIFIED_SLASH
"qualified-slash"
|
static java.lang.String |
VAL_SLASH
"slash"
|
static java.lang.String |
VAL_STATE
"state"
|
static java.lang.String |
VAL_STRING
"string"
|
static java.lang.String |
VAL_STRUCTURED
"structured"
|
static java.lang.String |
VAL_TELENUMBER
"teleNumber"
|
static java.lang.String |
VAL_TIME
"time"
|
static java.lang.String |
VAL_TRUE
"true"
|
| Constructor and Description |
|---|
SchemaDef()
Construct a new, empty
SchemaDef instance. |
SchemaDef(org.w3c.dom.Element schemaDef)
Construct a
SchemaDef instance based on an XML representation. |
SchemaDef(SchemaDef source)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getApplicationName()
Get the value for the "application-name" attribute.
|
SchemaDef.ClassDef |
getClassDef(java.lang.String className)
Get a
ClassDef instance from this SchemaDef instance
based on class name. |
java.lang.String |
getDNDelims()
Get the value for the "dn-delims" attribute.
|
int |
getDNFormat()
Get the value for the "dn-delims" attribute.
|
static int |
getDNFormatFromString(java.lang.String dnFormatString)
Get the integer value corresponding to a "dn-format" string value.
|
static java.lang.String |
getDNFormatString(int dnFormat)
Get the string corresponding to a "dn-format" integer value.
|
boolean |
getHierarchical()
Get the value for the "hierarchical" attribute.
|
boolean |
hasBeenModified()
Return
true if this instance has been modified. |
java.util.Iterator |
iterator()
Return an
Iterator that will iterate over the ClassDef instances
in this SchemaDef instance. |
SchemaDef.ClassDef |
newClass(java.lang.String className)
Add a new
ClassDef instance. |
boolean |
removeClass(java.lang.String className)
Remove a ClassDef from this instance based on name.
|
void |
resetModified()
Reset the modified flag for this instance such that
hasBeenModified()
will return false. |
void |
setApplicationName(java.lang.String newName)
Set the value for the "application-name" attribute.
|
void |
setDNDelims(java.lang.String newDelims)
Set the value for the "dn-delims" attribute.
|
void |
setDNFormat(int format)
Set the value for the "dn-delims" attribute.
|
void |
setHierarchical(boolean value)
Set the value for the "hierarchical" attribute.
|
org.w3c.dom.Element |
toXML(org.w3c.dom.Node parent)
Create an XML representation for this instance under the passed
Node. |
public static final java.lang.String TAG_SCHEMA_DEF
public static final java.lang.String TAG_CLASS_DEF
public static final java.lang.String TAG_ATTR_DEF
public static final java.lang.String ATTR_APPLICATION_NAME
public static final java.lang.String ATTR_DN_DELIMS
public static final java.lang.String ATTR_DN_FORMAT
public static final java.lang.String ATTR_HIERARCHICAL
public static final java.lang.String ATTR_ASN1ID
public static final java.lang.String ATTR_CLASS_NAME
public static final java.lang.String ATTR_CONTAINER
public static final java.lang.String ATTR_ATTR_NAME
public static final java.lang.String ATTR_CASE_SENSITIVE
public static final java.lang.String ATTR_MULTI_VALUED
public static final java.lang.String ATTR_NAMING
public static final java.lang.String ATTR_READ_ONLY
public static final java.lang.String ATTR_REQUIRED
public static final java.lang.String ATTR_TYPE
public static final java.lang.String VAL_TRUE
public static final java.lang.String VAL_FALSE
public static final java.lang.String VAL_DOT
public static final java.lang.String VAL_QUALIFIED_DOT
public static final java.lang.String VAL_SLASH
public static final java.lang.String VAL_QUALIFIED_SLASH
public static final java.lang.String VAL_LDAP
public static final java.lang.String VAL_STRING
public static final java.lang.String VAL_TELENUMBER
public static final java.lang.String VAL_INT
public static final java.lang.String VAL_STATE
public static final java.lang.String VAL_COUNTER
public static final java.lang.String VAL_DN
public static final java.lang.String VAL_INTERVAL
public static final java.lang.String VAL_OCTET
public static final java.lang.String VAL_TIME
public static final java.lang.String VAL_STRUCTURED
public static final java.lang.String VAL_CLASSNAME
public static final int ATTR_TYPE_STRING
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_TELENUMBER
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_INT
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_STATE
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_COUNTER
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_DN
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_INTERVAL
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_OCTET
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_TIME
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_STRUCTURED
AttrDef.getType() and AttrDef.setType().public static final int ATTR_TYPE_CLASSNAME
AttrDef.getType() and AttrDef.setType().public static final int DN_FORMAT_DOT
SchemaDef.getDNFormat() and SchemaDef.setDNFormat().getDNFormat(),
setDNFormat(int),
Constant Field Valuespublic static final int DN_FORMAT_QUALIFIED_DOT
SchemaDef.getDNFormat() and SchemaDef.setDNFormat().getDNFormat(),
setDNFormat(int),
Constant Field Valuespublic static final int DN_FORMAT_SLASH
SchemaDef.getDNFormat() and SchemaDef.setDNFormat().getDNFormat(),
setDNFormat(int),
Constant Field Valuespublic static final int DN_FORMAT_QUALIFIED_SLASH
SchemaDef.getDNFormat() and SchemaDef.setDNFormat().getDNFormat(),
setDNFormat(int),
Constant Field Valuespublic static final int DN_FORMAT_LDAP
SchemaDef.getDNFormat() and SchemaDef.setDNFormat().getDNFormat(),
setDNFormat(int),
Constant Field Valuespublic SchemaDef()
SchemaDef instance.public SchemaDef(org.w3c.dom.Element schemaDef)
throws XMLException
SchemaDef instance based on an XML representation.schemaDef - the <schema-def> elementXMLException - thrown if there is an error in the XML representationpublic SchemaDef(SchemaDef source)
source - the SchemaDef instance to copypublic java.lang.String getApplicationName()
nullpublic void setApplicationName(java.lang.String newName)
newName - new value for "application-name" (may be null)public java.lang.String getDNDelims()
nullpublic void setDNDelims(java.lang.String newDelims)
newDelims - new value for "dn-delims" (may be null)public int getDNFormat()
DN_FORMAT_DOT, DN_FORMAT_QUALIFIED_DOT, etc.public void setDNFormat(int format)
throws java.lang.IllegalArgumentException
format - one of DN_FORMAT_DOT, DN_FORMAT_QUALIFIED_DOT, etc.java.lang.IllegalArgumentException - thrown if format parameter is incorrectpublic boolean getHierarchical()
true or falsepublic void setHierarchical(boolean value)
value - true or falsepublic SchemaDef.ClassDef getClassDef(java.lang.String className)
ClassDef instance from this SchemaDef instance
based on class name.className - the name of the classnull or a ClassDef instancepublic SchemaDef.ClassDef newClass(java.lang.String className) throws java.lang.IllegalStateException
ClassDef instance.className - name of new classClassDef instancejava.lang.IllegalStateException - thrown if a ClassDef already exists with
the passed namepublic boolean removeClass(java.lang.String className)
className - name of class to be removedClassDef was removedpublic static int getDNFormatFromString(java.lang.String dnFormatString)
throws java.lang.IllegalArgumentException
dnFormatString - "dot", "qualified-dot", "slash", "qualified-slash", "ldap"java.lang.IllegalArgumentException - thrown if dnFormatString is not a valid valuepublic static java.lang.String getDNFormatString(int dnFormat)
throws java.lang.IllegalArgumentException
dnFormat - DN_FORMAT_DOT, DN_FORMAT_QUALIFIED_DOT, etc.java.lang.IllegalArgumentException - thrown if dnFormat is not a valid valuepublic java.util.Iterator iterator()
Iterator that will iterate over the ClassDef instances
in this SchemaDef instance.Iterator whose next() method returns ClassDef instancespublic boolean hasBeenModified()
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:
resetModified() was last calledhasBeenModified in interface ConfigElementtrue or falseresetModified()public void resetModified()
hasBeenModified()
will return false.resetModified in interface ConfigElementhasBeenModified()public org.w3c.dom.Element toXML(org.w3c.dom.Node parent)
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().toXML in interface ConfigElementparent - Node under which to construct XML representation.ElementhasBeenModified(),
resetModified()