|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The basic interface for Java objects representing primitive ASN.1 types
according to ITU-T Recommendation X.680. A special feature are
constraints. With constraints the range of valid values
of an ASN.1 type can be limited. Constraints are validated for most types in
the setter methods allowing initialization with Java types.
An abstract implementation of most of the methods declared in this interface
can be found in ASN1AbstractType.
| Method Summary | |
void |
checkConstraints()
Checks the constraints registered with this instance. |
void |
decode(Decoder dec)
|
void |
encode(Encoder enc)
|
Constraint |
getConstraint()
Returns the Constraint of this type or
null if there is none. |
int |
getTag()
|
int |
getTagClass()
|
Object |
getValue()
|
boolean |
isExplicit()
|
boolean |
isOptional()
|
boolean |
isType(int tag,
int tagclass)
Returns true if this type matches the given tag and
tagclass. |
void |
setConstraint(Constraint o)
Sets a constraint for this type. |
void |
setExplicit(boolean explicit)
|
void |
setOptional(boolean optional)
|
| Method Detail |
public Object getValue()
public void setOptional(boolean optional)
public boolean isOptional()
public int getTag()
public int getTagClass()
public void setExplicit(boolean explicit)
public boolean isExplicit()
public boolean isType(int tag,
int tagclass)
true if this type matches the given tag and
tagclass. This method is primarily used by decoders in order to verify
the tag and tag class of a decoded type. Basic types need not implement
this method since ASN1AbstractType provides a
default implementation. Certain variable types such as ASN1Choice and ASN1OpenType implement this method.
This helps decoders to determine if a decoded type matches a given ASN.1
structure.tag - The tag to match.tagclass - The tag class to match.true if this type matches the given tag and tag
class.
public void encode(Encoder enc)
throws ASN1Exception,
IOException
public void decode(Decoder dec)
throws ASN1Exception,
IOException
public void setConstraint(Constraint o)
constraint for this type. Constraints are
checked by setter methods and as the last operation of a call to the
decode() method.
A number of constraints can be defined in ASN.1; one example is the SIZE
constraint on string types. For instance,
foo IA5String (SIZE 10..20) means the string foo
can be 10 to 20 characters long. Strings can also be constrained with
regard to the character sets. The constraint model of this package allows
to add arbitrary constraints on types.
o - The constraint to set.public Constraint getConstraint()
Constraint of this type or
null if there is none.null.
public void checkConstraints()
throws ConstraintException
constraints registered with this instance.Constraint,
ConstraintCollection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||