Top Description Fields Constructors Methods
org.bouncycastle.oer

public Class Element

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.util.ArrayList, .Collections, .Iterator, .List, .Map, org.bouncycastle.asn1.ASN1Encodable

OER Element is the result of building the OER definition.

Field Summary

Modifier and TypeField and Description
private final Switch
private final OERDefinition.BaseType
private final int
block

This element is in the extension area of another element.

private final List<Element>
private final ASN1Encodable
private final boolean
private final ElementSupplier
private final BigInteger
private final boolean
private final boolean
private final String
private final BigInteger
private final boolean
private List<Element>
private final int
private Element
private final Map<String, ElementSupplier>
private final String
private final BigInteger
private List<ASN1Encodable>

Constructor Summary

AccessConstructor and Description
public
Element(OERDefinition.BaseType baseType, List<Element> children, boolean explicit, String label, BigInteger lowerBound, BigInteger upperBound, boolean extensionsInDefinition, BigInteger enumValue, ASN1Encodable defaultValue, Switch aSwitch, List<ASN1Encodable> switchValues, ElementSupplier elementSupplier, boolean mayRecurse, String typeName, Map<String, ElementSupplier> supplierMap, int block, int optionals, boolean defaultValuesInChildren)

public
Element(Element element, Element parent)

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public static Element

Returns:

the expanded definition or the passed in element if it has no supplier.
expandDeferredDefinition
(Element
The element.
e
,
Element parent)

Expands the definition if the element holds an element supplier.

public Switch
public OERDefinition.BaseType
public int
public List<Element>
public ASN1Encodable
public String
public ElementSupplier
public BigInteger
public Element
public String
public BigInteger
public List<Element>
public int
public Element
public String
public BigInteger
public List<ASN1Encodable>
public boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public int
intBytesForRange()

Determine the number of integer bytes for a range, ints, signed or unsigned that can fit into 1 to 8 octets use a fixed with encoding.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true if condition met.
isUnsignedWithRange
()

Return true in cases where the range is all positive (0 ..

public List<Element>
public String
public ElementSupplier
protected ElementSupplier
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

aSwitchback to summary
private final Switch aSwitch
baseTypeback to summary
private final OERDefinition.BaseType baseType
blockback to summary
private final int block

This element is in the extension area of another element.

childrenback to summary
private final List<Element> children
defaultValueback to summary
private final ASN1Encodable defaultValue
defaultValuesInChildrenback to summary
private final boolean defaultValuesInChildren
elementSupplierback to summary
private final ElementSupplier elementSupplier
enumValueback to summary
private final BigInteger enumValue
explicitback to summary
private final boolean explicit
extensionsInDefinitionback to summary
private final boolean extensionsInDefinition
labelback to summary
private final String label
lowerBoundback to summary
private final BigInteger lowerBound
mayRecurseback to summary
private final boolean mayRecurse
optionalChildrenInOrderback to summary
private List<Element> optionalChildrenInOrder
optionalsback to summary
private final int optionals
parentback to summary
private Element parent
supplierMapback to summary
private final Map<String, ElementSupplier> supplierMap
typeNameback to summary
private final String typeName
upperBoundback to summary
private final BigInteger upperBound
validSwitchValuesback to summary
private List<ASN1Encodable> validSwitchValues

Constructor Detail

Elementback to summary
public Element(OERDefinition.BaseType baseType, List<Element> children, boolean explicit, String label, BigInteger lowerBound, BigInteger upperBound, boolean extensionsInDefinition, BigInteger enumValue, ASN1Encodable defaultValue, Switch aSwitch, List<ASN1Encodable> switchValues, ElementSupplier elementSupplier, boolean mayRecurse, String typeName, Map<String, ElementSupplier> supplierMap, int block, int optionals, boolean defaultValuesInChildren)
Elementback to summary
public Element(Element element, Element parent)

Method Detail

appendLabelback to summary
public String appendLabel(String s)
canBeNegativeback to summary
public boolean canBeNegative()
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
expandDeferredDefinitionback to summary
public static Element expandDeferredDefinition(Element e, Element parent)

Expands the definition if the element holds an element supplier.

Parameters
e:Element

The element.

Returns:Element

the expanded definition or the passed in element if it has no supplier.

getaSwitchback to summary
public Switch getaSwitch()
getBaseTypeback to summary
public OERDefinition.BaseType getBaseType()
getBlockback to summary
public int getBlock()
getChildrenback to summary
public List<Element> getChildren()
getDefaultValueback to summary
public ASN1Encodable getDefaultValue()
getDerivedTypeNameback to summary
public String getDerivedTypeName()
getElementSupplierback to summary
public ElementSupplier getElementSupplier()
getEnumValueback to summary
public BigInteger getEnumValue()
getFirstChidback to summary
public Element getFirstChid()
getLabelback to summary
public String getLabel()
getLowerBoundback to summary
public BigInteger getLowerBound()
getOptionalChildrenInOrderback to summary
public List<Element> getOptionalChildrenInOrder()
getOptionalsback to summary
public int getOptionals()
getParentback to summary
public Element getParent()
getTypeNameback to summary
public String getTypeName()
getUpperBoundback to summary
public BigInteger getUpperBound()
getValidSwitchValuesback to summary
public List<ASN1Encodable> getValidSwitchValues()
hasDefaultChildrenback to summary
public boolean hasDefaultChildren()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasPopulatedExtensionback to summary
public boolean hasPopulatedExtension()
intBytesForRangeback to summary
public int intBytesForRange()

Determine the number of integer bytes for a range, ints, signed or unsigned that can fit into 1 to 8 octets use a fixed with encoding. Returns a negative number if the value is signed and the absolute value is the number of bytes.

isExplicitback to summary
public boolean isExplicit()
isExtensionsInDefinitionback to summary
public boolean isExtensionsInDefinition()
isFixedLengthback to summary
public boolean isFixedLength()
isLowerRangeZeroback to summary
public boolean isLowerRangeZero()
isMayRecurseback to summary
public boolean isMayRecurse()
isUnboundedback to summary
public boolean isUnbounded()
isUnsignedWithRangeback to summary
public boolean isUnsignedWithRange()

Return true in cases where the range is all positive (0 .. 10)

Returns:boolean

true if condition met.

optionalOrDefaultChildrenInOrderback to summary
public List<Element> optionalOrDefaultChildrenInOrder()
rangeExpressionback to summary
public String rangeExpression()
resolveSupplierback to summary
public ElementSupplier resolveSupplier()
resolveSupplierback to summary
protected ElementSupplier resolveSupplier(String name)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override