Class Element


  • public class Element
    extends java.lang.Object
    OER Element is the result of building the OER definition.
    • 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 class java.lang.Object
      • 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()
      • 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

        protected ElementSupplier resolveSupplier​(java.lang.String name)
      • getParent

        public Element getParent()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object