Package com.oss.metadata
Class InnerTypeConstraint
java.lang.Object
com.oss.metadata.Constraints
com.oss.metadata.InnerTypeConstraint
The InnerTypeConstraint class represents the ASN.1 type constraints
notation for WITH COMPONENTS which is the constraint definition
for a component within
the InnerTypeConstraints definition for SET, SEQUENCE, and CHOICE types.
The information found here is the valueConstraint and presenceConstraint
for one component.
Example:
Lx ::= SEQUENCE { age INTEGER OPTIONAL, name PrintableString OPTIONAL, address VisibleString } (WITH COMPONENTS { ..., -- '...' indicates PartialSpecification age (20) -- 'age' with a value constraint name ABSENT -- explicitly constrained as absent -- no constraint placed on 'address' })
- Since:
- ASN.1/Java 2.1
-
Method Summary
Modifier and TypeMethodDescriptionReturn the Constraints which represent the value constraints of the InnerTypeConstraint.int
Return the index of this field.boolean
Return true if the field which has this constraint must be mandatory and false otherwiseboolean
Return true if the field which has this constraint can be optional and false otherwise.static InnerTypeConstraint
MissingConstraint
(int index) Return a newly created Constraint that is constrained to be absent and has no value constraint.boolean
Return true if the field which has this constraint must be absent and false otherwise.boolean
Return true if the field which has this constraint must be present (cannot be optional) and false otherwise.
-
Method Details
-
MissingConstraint
Return a newly created Constraint that is constrained to be absent and has no value constraint.- Parameters:
index
- an index into Fields list for the type.- Returns:
- an InnerTypeConstraint that is constrained to be absent.
-
getConstraints
Return the Constraints which represent the value constraints of the InnerTypeConstraint.- Returns:
- field value constraints if any
-
mustBePresent
public boolean mustBePresent()Return true if the field which has this constraint must be present (cannot be optional) and false otherwise.- Returns:
- true if field value must be present
-
mustBeAbsent
public boolean mustBeAbsent()Return true if the field which has this constraint must be absent and false otherwise.- Returns:
- true if field value must be absent
-
isOptional
public boolean isOptional()Return true if the field which has this constraint can be optional and false otherwise.- Returns:
- true if field value must be present or absent
-
isMandatory
public boolean isMandatory()Return true if the field which has this constraint must be mandatory and false otherwise- Returns:
- true if field value is not optional and therefore there is no presence constraint
-
getFieldIndex
public int getFieldIndex()Return the index of this field. Valid field indexes start at 0.- Returns:
- field index
-