Package org.bouncycastle.oer
Class Element
- java.lang.Object
-
- org.bouncycastle.oer.Element
-
public class Element extends java.lang.ObjectOER 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.StringappendLabel(java.lang.String s)booleancanBeNegative()booleanequals(java.lang.Object o)static ElementexpandDeferredDefinition(Element e, Element parent)Expands the definition if the element holds an element supplier.SwitchgetaSwitch()OERDefinition.BaseTypegetBaseType()intgetBlock()java.util.List<Element>getChildren()org.bouncycastle.asn1.ASN1EncodablegetDefaultValue()java.lang.StringgetDerivedTypeName()ElementSuppliergetElementSupplier()java.math.BigIntegergetEnumValue()ElementgetFirstChid()java.lang.StringgetLabel()java.math.BigIntegergetLowerBound()java.util.List<Element>getOptionalChildrenInOrder()intgetOptionals()ElementgetParent()java.lang.StringgetTypeName()java.math.BigIntegergetUpperBound()java.util.List<org.bouncycastle.asn1.ASN1Encodable>getValidSwitchValues()booleanhasDefaultChildren()inthashCode()booleanhasPopulatedExtension()intintBytesForRange()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.booleanisExplicit()booleanisExtensionsInDefinition()booleanisFixedLength()booleanisLowerRangeZero()booleanisMayRecurse()booleanisUnbounded()booleanisUnsignedWithRange()Return true in cases where the range is all positive (0 ..java.util.List<Element>optionalOrDefaultChildrenInOrder()java.lang.StringrangeExpression()ElementSupplierresolveSupplier()protected ElementSupplierresolveSupplier(java.lang.String name)java.lang.StringtoString()
-
-
-
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:
toStringin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-