Java Doc for Attribute.java in  » 6.0-JDK-Core » naming » javax » naming » directory » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » naming » javax.naming.directory 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.naming.directory.Attribute

All known Subclasses:   javax.naming.directory.BasicAttribute,
Attribute
public interface Attribute extends Cloneable,java.io.Serializable(Code)
This interface represents an attribute associated with a named object.

In a directory, named objects can have associated with them attributes. The Attribute interface represents an attribute associated with a named object. An attribute contains 0 or more, possibly null, values. The attribute values can be ordered or unordered (see isOrdered()). If the values are unordered, no duplicates are allowed. If the values are ordered, duplicates are allowed.

The content and representation of an attribute and its values is defined by the attribute's schema. The schema contains information about the attribute's syntax and other properties about the attribute. See getAttributeDefinition() and getAttributeSyntaxDefinition() for details regarding how to get schema information about an attribute if the underlying directory service supports schemas.

Equality of two attributes is determined by the implementation class. A simple implementation can use Object.equals() to determine equality of attribute values, while a more sophisticated implementation might make use of schema information to determine equality. Similarly, one implementation might provide a static storage structure which simply returns the values passed to its constructor, while another implementation might define get() and getAll(). to get the values dynamically from the directory.

Note that updates to Attribute (such as adding or removing a value) do not affect the corresponding representation of the attribute in the directory. Updates to the directory can only be effected using operations in the DirContext interface.
author:
   Rosanna Lee
author:
   Scott Seligman
version:
   1.19 07/05/05
See Also:   BasicAttribute
since:
   1.3



Field Summary
final static  longserialVersionUID
     Use serialVersionUID from JNDI 1.1.1 for interoperability.


Method Summary
 booleanadd(Object attrVal)
     Adds a new value to the attribute.
 voidadd(int ix, Object attrVal)
     Adds an attribute value to the ordered list of attribute values.
 voidclear()
     Removes all values from this attribute.
 Objectclone()
     Makes a copy of the attribute.
 booleancontains(Object attrVal)
     Determines whether a value is in the attribute. Equality is determined by the implementation, which may use Object.equals() or schema information to determine equality.
Parameters:
  attrVal - The possibly null value to check.
 Objectget()
     Retrieves one of this attribute's values. If the attribute has more than one value and is unordered, any one of the values is returned. If the attribute has more than one value and is ordered, the first value is returned. A possibly null object representing one of the attribute's value.
 Objectget(int ix)
     Retrieves the attribute value from the ordered list of attribute values. This method returns the value at the ix index of the list of attribute values. If the attribute values are unordered, this method returns the value that happens to be at that index.
Parameters:
  ix - The index of the value in the ordered list of attribute values.0 <= ix < size().
 NamingEnumerationgetAll()
     Retrieves an enumeration of the attribute's values. The behaviour of this enumeration is unspecified if the attribute's values are added, changed, or removed while the enumeration is in progress. If the attribute values are ordered, the enumeration's items will be ordered. A non-null enumeration of the attribute's values.Each element of the enumeration is a possibly null Object.
 DirContextgetAttributeDefinition()
     Retrieves the attribute's schema definition. An attribute's schema definition contains information such as whether the attribute is multivalued or single-valued, the matching rules to use when comparing the attribute's values. The information that you can retrieve from an attribute definition is directory-dependent.

If an implementation does not support schemas, it should throw OperationNotSupportedException.

 DirContextgetAttributeSyntaxDefinition()
     Retrieves the syntax definition associated with the attribute. An attribute's syntax definition specifies the format of the attribute's value(s).
 StringgetID()
     Retrieves the id of this attribute. The id of this attribute.
 booleanisOrdered()
     Determines whether this attribute's values are ordered.
 booleanremove(Object attrval)
     Removes a specified value from the attribute. If attrval is not in the attribute, this method does nothing. If the attribute values are ordered, the first occurrence of attrVal is removed and attribute values at indices greater than the removed value are shifted up towards the head of the list (and their indices decremented by one).

Equality is determined by the implementation, which may use Object.equals() or schema information to determine equality.
Parameters:
  attrval - The possibly null value to remove from this attribute.If null, remove the attribute value that is null.

 Objectremove(int ix)
     Removes an attribute value from the ordered list of attribute values. This method removes the value at the ix index of the list of attribute values.
 Objectset(int ix, Object attrVal)
     Sets an attribute value in the ordered list of attribute values. This method sets the value at the ix index of the list of attribute values to be attrVal.
 intsize()
     Retrieves the number of values in this attribute.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)
Use serialVersionUID from JNDI 1.1.1 for interoperability.





Method Detail
add
boolean add(Object attrVal)(Code)
Adds a new value to the attribute. If the attribute values are unordered and attrVal is already in the attribute, this method does nothing. If the attribute values are ordered, attrVal is added to the end of the list of attribute values.

Equality is determined by the implementation, which may use Object.equals() or schema information to determine equality.
Parameters:
  attrVal - The new possibly null value to add. If null, nullis added as an attribute value. true if a value was added; false otherwise.




add
void add(int ix, Object attrVal)(Code)
Adds an attribute value to the ordered list of attribute values. This method adds attrVal to the list of attribute values at index ix. Values located at indices at or greater than ix are shifted down towards the end of the list (and their indices incremented by one). If the attribute values are unordered and already have attrVal, IllegalStateException is thrown.
Parameters:
  ix - The index in the ordered list of attribute values to add the new value.0 <= ix <= size().
Parameters:
  attrVal - The possibly null attribute value to add; if null, null isthe value added.
exception:
  IndexOutOfBoundsException - If ix is outside the specified range.
exception:
  IllegalStateException - If the attribute values are unordered andattrVal is one of those values.



clear
void clear()(Code)
Removes all values from this attribute.



clone
Object clone()(Code)
Makes a copy of the attribute. The copy contains the same attribute values as the original attribute: the attribute values are not themselves cloned. Changes to the copy will not affect the original and vice versa. A non-null copy of the attribute.



contains
boolean contains(Object attrVal)(Code)
Determines whether a value is in the attribute. Equality is determined by the implementation, which may use Object.equals() or schema information to determine equality.
Parameters:
  attrVal - The possibly null value to check. If null, checkwhether the attribute has an attribute value whose value is null. true if attrVal is one of this attribute's values; false otherwise.
See Also:   java.lang.Object.equals
See Also:   BasicAttribute.equals



get
Object get() throws NamingException(Code)
Retrieves one of this attribute's values. If the attribute has more than one value and is unordered, any one of the values is returned. If the attribute has more than one value and is ordered, the first value is returned. A possibly null object representing one of the attribute's value. It is null if the attribute's valueis null.
exception:
  NamingException - If a naming exception was encountered while retrievingthe value.
exception:
  java.util.NoSuchElementException - If this attribute has no values.



get
Object get(int ix) throws NamingException(Code)
Retrieves the attribute value from the ordered list of attribute values. This method returns the value at the ix index of the list of attribute values. If the attribute values are unordered, this method returns the value that happens to be at that index.
Parameters:
  ix - The index of the value in the ordered list of attribute values.0 <= ix < size(). The possibly null attribute value at index ix; null if the attribute value is null.
exception:
  NamingException - If a naming exception was encountered whileretrieving the value.
exception:
  IndexOutOfBoundsException - If ix is outside the specified range.



getAll
NamingEnumeration getAll() throws NamingException(Code)
Retrieves an enumeration of the attribute's values. The behaviour of this enumeration is unspecified if the attribute's values are added, changed, or removed while the enumeration is in progress. If the attribute values are ordered, the enumeration's items will be ordered. A non-null enumeration of the attribute's values.Each element of the enumeration is a possibly null Object. The object'sclass is the class of the attribute value. The element is nullif the attribute's value is null.If the attribute has zero values, an empty enumeration is returned.
exception:
  NamingException - If a naming exception was encountered while retrievingthe values.
See Also:   Attribute.isOrdered



getAttributeDefinition
DirContext getAttributeDefinition() throws NamingException(Code)
Retrieves the attribute's schema definition. An attribute's schema definition contains information such as whether the attribute is multivalued or single-valued, the matching rules to use when comparing the attribute's values. The information that you can retrieve from an attribute definition is directory-dependent.

If an implementation does not support schemas, it should throw OperationNotSupportedException. If an implementation does support schemas, it should define this method to return the appropriate information. This attribute's schema definition. Null if the implementationsupports schemas but this particular attribute does not haveany schema information.
exception:
  OperationNotSupportedException - If getting the schemais not supported.
exception:
  NamingException - If a naming exception occurs while gettingthe schema.




getAttributeSyntaxDefinition
DirContext getAttributeSyntaxDefinition() throws NamingException(Code)
Retrieves the syntax definition associated with the attribute. An attribute's syntax definition specifies the format of the attribute's value(s). Note that this is different from the attribute value's representation as a Java object. Syntax definition refers to the directory's notion of syntax.

For example, even though a value might be a Java String object, its directory syntax might be "Printable String" or "Telephone Number". Or a value might be a byte array, and its directory syntax is "JPEG" or "Certificate". For example, if this attribute's syntax is "JPEG", this method would return the syntax definition for "JPEG".

The information that you can retrieve from a syntax definition is directory-dependent.

If an implementation does not support schemas, it should throw OperationNotSupportedException. If an implementation does support schemas, it should define this method to return the appropriate information. The attribute's syntax definition. Null if the implementationsupports schemas but this particular attribute does not haveany schema information.
exception:
  OperationNotSupportedException - If getting the schemais not supported.
exception:
  NamingException - If a naming exception occurs while gettingthe schema.




getID
String getID()(Code)
Retrieves the id of this attribute. The id of this attribute. It cannot be null.



isOrdered
boolean isOrdered()(Code)
Determines whether this attribute's values are ordered. If an attribute's values are ordered, duplicate values are allowed. If an attribute's values are unordered, they are presented in any order and there are no duplicate values. true if this attribute's values are ordered; false otherwise.
See Also:   Attribute.get(int)
See Also:   Attribute.remove(int)
See Also:   Attribute.add(int,java.lang.Object)
See Also:   Attribute.set(int,java.lang.Object)



remove
boolean remove(Object attrval)(Code)
Removes a specified value from the attribute. If attrval is not in the attribute, this method does nothing. If the attribute values are ordered, the first occurrence of attrVal is removed and attribute values at indices greater than the removed value are shifted up towards the head of the list (and their indices decremented by one).

Equality is determined by the implementation, which may use Object.equals() or schema information to determine equality.
Parameters:
  attrval - The possibly null value to remove from this attribute.If null, remove the attribute value that is null. true if the value was removed; false otherwise.




remove
Object remove(int ix)(Code)
Removes an attribute value from the ordered list of attribute values. This method removes the value at the ix index of the list of attribute values. If the attribute values are unordered, this method removes the value that happens to be at that index. Values located at indices greater than ix are shifted up towards the front of the list (and their indices decremented by one).
Parameters:
  ix - The index of the value to remove.0 <= ix < size(). The possibly null attribute value at index ix that was removed; null if the attribute value is null.
exception:
  IndexOutOfBoundsException - If ix is outside the specified range.



set
Object set(int ix, Object attrVal)(Code)
Sets an attribute value in the ordered list of attribute values. This method sets the value at the ix index of the list of attribute values to be attrVal. The old value is removed. If the attribute values are unordered, this method sets the value that happens to be at that index to attrVal, unless attrVal is already one of the values. In that case, IllegalStateException is thrown.
Parameters:
  ix - The index of the value in the ordered list of attribute values.0 <= ix < size().
Parameters:
  attrVal - The possibly null attribute value to use. If null, 'null' replaces the old value. The possibly null attribute value at index ix that was replaced. Null if the attribute value was null.
exception:
  IndexOutOfBoundsException - If ix is outside the specified range.
exception:
  IllegalStateException - If attrVal already exists and theattribute values are unordered.



size
int size()(Code)
Retrieves the number of values in this attribute. The nonnegative number of values in this attribute.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.