Package org.bouncycastle.oer
Class Element
- java.lang.Object
-
- org.bouncycastle.oer.Element
-
public class Element extends java.lang.Object
OER Element is the result of building the OER definition.
-
-
Constructor Summary
Constructors Constructor Description Element(Element element, Element parent)
Element(OERDefinition.BaseType baseType, java.util.List<Element> children, boolean explicit, java.lang.String label, java.math.BigInteger lowerBound, java.math.BigInteger upperBound, boolean extensionsInDefinition, java.math.BigInteger enumValue, org.bouncycastle.asn1.ASN1Encodable defaultValue, Switch aSwitch, java.util.List<org.bouncycastle.asn1.ASN1Encodable> switchValues, ElementSupplier elementSupplier, boolean mayRecurse, java.lang.String typeName, java.util.Map<java.lang.String,ElementSupplier> supplierMap, int block, int optionals, boolean defaultValuesInChildren)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
appendLabel(java.lang.String s)
boolean
canBeNegative()
boolean
equals(java.lang.Object o)
static Element
expandDeferredDefinition(Element e, Element parent)
Expands the definition if the element holds an element supplier.Switch
getaSwitch()
OERDefinition.BaseType
getBaseType()
int
getBlock()
java.util.List<Element>
getChildren()
org.bouncycastle.asn1.ASN1Encodable
getDefaultValue()
java.lang.String
getDerivedTypeName()
ElementSupplier
getElementSupplier()
java.math.BigInteger
getEnumValue()
Element
getFirstChid()
java.lang.String
getLabel()
java.math.BigInteger
getLowerBound()
java.util.List<Element>
getOptionalChildrenInOrder()
int
getOptionals()
Element
getParent()
java.lang.String
getTypeName()
java.math.BigInteger
getUpperBound()
java.util.List<org.bouncycastle.asn1.ASN1Encodable>
getValidSwitchValues()
boolean
hasDefaultChildren()
int
hashCode()
boolean
hasPopulatedExtension()
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.boolean
isExplicit()
boolean
isExtensionsInDefinition()
boolean
isFixedLength()
boolean
isLowerRangeZero()
boolean
isMayRecurse()
boolean
isUnbounded()
boolean
isUnsignedWithRange()
Return true in cases where the range is all positive (0 .. 10)java.util.List<Element>
optionalOrDefaultChildrenInOrder()
java.lang.String
rangeExpression()
ElementSupplier
resolveSupplier()
protected ElementSupplier
resolveSupplier(java.lang.String name)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Element
public Element(OERDefinition.BaseType baseType, java.util.List<Element> children, boolean explicit, java.lang.String label, java.math.BigInteger lowerBound, java.math.BigInteger upperBound, boolean extensionsInDefinition, java.math.BigInteger enumValue, org.bouncycastle.asn1.ASN1Encodable defaultValue, Switch aSwitch, java.util.List<org.bouncycastle.asn1.ASN1Encodable> switchValues, ElementSupplier elementSupplier, boolean mayRecurse, java.lang.String typeName, java.util.Map<java.lang.String,ElementSupplier> supplierMap, int block, int optionals, boolean defaultValuesInChildren)
-
-
Method Detail
-
expandDeferredDefinition
public static Element expandDeferredDefinition(Element e, Element parent)
Expands the definition if the element holds an element supplier.- Parameters:
e
- The element.parent
-- Returns:
- the expanded definition or the passed in element if it has no supplier.
-
rangeExpression
public java.lang.String rangeExpression()
-
appendLabel
public java.lang.String appendLabel(java.lang.String s)
-
optionalOrDefaultChildrenInOrder
public java.util.List<Element> optionalOrDefaultChildrenInOrder()
-
isUnbounded
public boolean isUnbounded()
-
isLowerRangeZero
public boolean isLowerRangeZero()
-
isUnsignedWithRange
public boolean isUnsignedWithRange()
Return true in cases where the range is all positive (0 .. 10)- Returns:
- true if condition met.
-
canBeNegative
public boolean canBeNegative()
-
intBytesForRange
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.
-
hasPopulatedExtension
public boolean hasPopulatedExtension()
-
hasDefaultChildren
public boolean hasDefaultChildren()
-
getDefaultValue
public org.bouncycastle.asn1.ASN1Encodable getDefaultValue()
-
getFirstChid
public Element getFirstChid()
-
isFixedLength
public boolean isFixedLength()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getBaseType
public OERDefinition.BaseType getBaseType()
-
getChildren
public java.util.List<Element> getChildren()
-
isExplicit
public boolean isExplicit()
-
getLabel
public java.lang.String getLabel()
-
getLowerBound
public java.math.BigInteger getLowerBound()
-
getUpperBound
public java.math.BigInteger getUpperBound()
-
isExtensionsInDefinition
public boolean isExtensionsInDefinition()
-
getEnumValue
public java.math.BigInteger getEnumValue()
-
getaSwitch
public Switch getaSwitch()
-
getOptionalChildrenInOrder
public java.util.List<Element> getOptionalChildrenInOrder()
-
getValidSwitchValues
public java.util.List<org.bouncycastle.asn1.ASN1Encodable> getValidSwitchValues()
-
getElementSupplier
public ElementSupplier getElementSupplier()
-
isMayRecurse
public boolean isMayRecurse()
-
getTypeName
public java.lang.String getTypeName()
-
getOptionals
public int getOptionals()
-
getBlock
public int getBlock()
-
getDerivedTypeName
public java.lang.String getDerivedTypeName()
-
resolveSupplier
public ElementSupplier resolveSupplier()
-
resolveSupplier
protected ElementSupplier resolveSupplier(java.lang.String name)
-
getParent
public Element getParent()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-