|
Directory SDK for Java 4.19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnetscape.ldap.LDAPAttribute
Represents the name and values of an attribute in an entry.
LDAPAttributeSet,
Serialized Form| Constructor Summary | |
LDAPAttribute(BERElement element)
Constructs an attribute from a BER (Basic Encoding Rules) element. |
|
LDAPAttribute(LDAPAttribute attr)
Constructs an attribute from another existing attribute. |
|
LDAPAttribute(String attrName)
Constructs an attribute with no values. |
|
LDAPAttribute(String attrName,
byte[] attrValue)
Constructs an attribute with a byte-formatted value. |
|
LDAPAttribute(String attrName,
String attrValue)
Constructs an attribute that has a single string value. |
|
LDAPAttribute(String attrName,
String[] attrValues)
Constructs an attribute that has an array of string values. |
|
| Method Summary | |
void |
addValue(byte[] attrValue)
Adds a byte[]-formatted value to the attribute. |
void |
addValue(String attrValue)
Adds a string value to the attribute. |
String |
getBaseName()
Extracts the base name from the attribute name of the current LDAPAttribute object. |
static String |
getBaseName(String attrName)
Extracts the base name from the specified attribute name. |
BERElement |
getBERElement()
Retrieves the BER (Basic Encoding Rules) representation of an attribute. |
byte[][] |
getByteValueArray()
Returns the values of the attribute in an array of byte[]
format. |
Enumeration |
getByteValues()
Returns an enumerator for the values of the attribute in byte[]
format. |
String |
getLangSubtype()
Extracts the language subtype from the attribute name of the LDAPAttribute object, if any. |
String |
getName()
Returns the name of the attribute. |
String[] |
getStringValueArray()
Returns the values of the attribute as an array of String
objects. |
Enumeration |
getStringValues()
Returns an enumerator for the string values of an attribute. |
String[] |
getSubtypes()
Extracts the subtypes from the attribute name of the current LDAPAttribute object. |
static String[] |
getSubtypes(String attrName)
Extracts the subtypes from the specified attribute name. |
boolean |
hasSubtype(String subtype)
Reports whether the attribute name contains the specified subtype. |
boolean |
hasSubtypes(String[] subtypes)
Reports if the attribute name contains all specified subtypes For example, if you check for the subtypes lang-en
and phonetic and the attribute name is
cn;lang-en;phonetic, this method returns true. |
void |
removeValue(byte[] attrValue)
Removes a byte[]-formatted value from the attribute. |
void |
removeValue(String attrValue)
Removes a string value from the attribute. |
int |
size()
Returns the number of values of the attribute. |
String |
toString()
Retrieves the string representation of an attribute in an LDAP entry. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LDAPAttribute(LDAPAttribute attr)
attr - the attribute to copypublic LDAPAttribute(String attrName)
attrName - name of the attribute
public LDAPAttribute(String attrName,
byte[] attrValue)
attrName - name of the attributeattrValue - value of the attribute in byte format
public LDAPAttribute(String attrName,
String attrValue)
attrName - name of the attributeattrValue - value of the attribute in String format
public LDAPAttribute(String attrName,
String[] attrValues)
attrName - name of the attributeattrValues - the list of string values for this attribute
public LDAPAttribute(BERElement element)
throws IOException
element - element that you want translated into an attribute
IOException - The attribute could not be created from
the specified element.| Method Detail |
public int size()
public Enumeration getStringValues()
public String[] getStringValueArray()
String
objects.
String object.public Enumeration getByteValues()
byte[]
format.
byte[].public byte[][] getByteValueArray()
byte[]
format.
byte[].public String getName()
public static String[] getSubtypes(String attrName)
cn;lang-ja;phonetic,
this method returns an array containing lang-ja
and phonetic.
attrName - name of the attribute from which to extract the subtypes
getBaseName(java.lang.String)public String[] getSubtypes()
LDAPAttribute object. For example, if the attribute
name is cn;lang-ja;phonetic, this method returns an array
containing lang-ja and phonetic.
public String getLangSubtype()
LDAPAttribute object, if any. For example, if the
attribute name is cn;lang-ja;phonetic, this method
returns the String lang-ja.
public static String getBaseName(String attrName)
cn;lang-ja;phonetic,
this method returns cn.
attrName - name of the attribute from which to extract the base name
getSubtypes(java.lang.String)public String getBaseName()
LDAPAttribute object. For example, if the attribute
name is cn;lang-ja;phonetic, this method returns
cn.
getSubtypes(java.lang.String)public boolean hasSubtype(String subtype)
lang-en
and the attribute name is cn;lang-en, this method
returns true.
subtype - the single subtype for which you want to check
getSubtypes(java.lang.String)public boolean hasSubtypes(String[] subtypes)
lang-en
and phonetic and the attribute name is
cn;lang-en;phonetic, this method returns true.
If the attribute name is cn;phonetic or
cn;lang-en, this method returns false.
subtypes - an array of subtypes to check
getSubtypes(java.lang.String)public void addValue(String attrValue)
attrValue - the string value to add to the attributepublic void addValue(byte[] attrValue)
byte[]-formatted value to the attribute.
attrValue - the byte[]-formatted value to
add to the attributepublic void removeValue(String attrValue)
attrValue - the string value to removepublic void removeValue(byte[] attrValue)
byte[]-formatted value from the attribute.
attrValue - byte[]-formatted value to removepublic BERElement getBERElement()
public String toString()
LDAPAttribute {type='cn', values='Barbara Jensen,Babs Jensen'}
|
Directory SDK for Java 4.19 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||