public class Attribute
extends java.lang.Object
implements java.io.Externalizable
X.501
and used in various PKIX and
PKCS protocols, consists of a type (OID) and a set of 1 or more values
defined by the given type.
Attribute ::= SEQUENCE { type AttributeType, values SET (1..MAX) OF AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY DEFINED BY AttributeType
AttributeSet
,
AttributeTypeAndValue
,
Serialized FormConstructor and Description |
---|
Attribute()
Creates a new empty instance.
|
Attribute(ASN1ObjectID type)
Creates a new
Attribute of the specified type, with no
values. |
Attribute(ASN1ObjectID type,
ASN1Object value)
Creates a new
Attribute of the specified type, with the
specified (single) value. |
Attribute(ASN1ObjectID type,
java.util.List<? extends ASN1Object> values)
Creates a new
Attribute of the specified type, with the
specified values. |
Attribute(ASN1ObjectID type,
java.util.Vector<? extends ASN1Object> values)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(ASN1Object value) |
ASN1ObjectID |
getType() |
java.util.Vector<ASN1Object> |
getValues()
Deprecated.
|
java.util.ArrayList<ASN1Object> |
getValuesAsList() |
void |
input(java.io.InputStream is) |
int |
length() |
void |
output(java.io.OutputStream os) |
void |
readExternal(java.io.ObjectInput is) |
void |
setValues(java.util.List<? extends ASN1Object> values) |
void |
setValues(java.util.Vector<? extends ASN1Object> values)
Deprecated.
Use
setValues(List) |
int |
size()
Returns the number of values defined for this
Attribute . |
java.lang.String |
toString() |
java.util.Enumeration<ASN1Object> |
values()
Deprecated.
|
void |
writeExternal(java.io.ObjectOutput os) |
public Attribute()
public Attribute(ASN1ObjectID type)
Attribute
of the specified type, with no
values.type
- OID specifiying the type of the attribute.public Attribute(ASN1ObjectID type, ASN1Object value)
Attribute
of the specified type, with the
specified (single) value.type
- OID specifiying the type of the attribute.value
- a value of the attribute.public Attribute(ASN1ObjectID type, java.util.Vector<? extends ASN1Object> values)
Attribute(ASN1ObjectID, List)
Attribute
of the specified type, with the
specified values.type
- OID specifiying the type of the attribute.values
- a vector containing 1 or more ASN1Object
values for
the attribute.public Attribute(ASN1ObjectID type, java.util.List<? extends ASN1Object> values)
Attribute
of the specified type, with the
specified values.type
- OID specifiying the type of the attribute.values
- a vector containing 1 or more ASN1Object
values for
the attribute.public ASN1ObjectID getType()
public void addValue(ASN1Object value)
public void setValues(java.util.Vector<? extends ASN1Object> values)
setValues(List)
public void setValues(java.util.List<? extends ASN1Object> values)
@Deprecated public java.util.Enumeration<ASN1Object> values()
Attribute
.Enumeration
of the ASN1Object
values.@Deprecated public java.util.Vector<ASN1Object> getValues()
public java.util.ArrayList<ASN1Object> getValuesAsList()
public int size()
Attribute
.public java.lang.String toString()
toString
in class java.lang.Object
public void input(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void output(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public int length()
public void writeExternal(java.io.ObjectOutput os) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput is) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException