Class IvmlElement

    • Constructor Detail

      • IvmlElement

        public IvmlElement()
    • Method Detail

      • initializeAttributes

        protected abstract void initializeAttributes()
        Lazily initializes the attributes.
      • initializeNested

        protected abstract void initializeNested()
        Lazily initializes the nested parts.
      • getName

        public abstract java.lang.String getName()
        Returns the simple name of the element.
        Specified by:
        getName in interface IResolvable
        Returns:
        the simple name
      • getQualifiedName

        public abstract java.lang.String getQualifiedName()
        Returns the qualified name of the element.
        Returns:
        the qualified name
      • getType

        public abstract TypeDescriptor<?> getType()
        Returns the VIL type of the element.
        Returns:
        the VIL type (may be a fake descriptor if not resolved / no advice)
      • getTypeName

        public abstract java.lang.String getTypeName()
        Returns the simple type name of the element.
        Returns:
        the simple type name
      • getQualifiedType

        public abstract java.lang.String getQualifiedType()
        Returns the qualified type name of the element.
        Returns:
        the qualified type name
      • getAttribute

        abstract IvmlElement getAttribute​(int index)
        Returns the specified attribute.
        Parameters:
        index - the 0-based index of the attribute to return
        Returns:
        the specified attribute
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= getAttributeCount()
      • getAttributeCount

        abstract int getAttributeCount()
        Returns the number of attributes.
        Returns:
        the number of attributes
      • getAttribute

        public IvmlElement getAttribute​(java.lang.String name)
        Returns the attribute specified by name (matches qualified and unqualified names).
        Parameters:
        name - the name of the element (no regex)
        Returns:
        the matching attribute or null
      • getAttribute

        public IvmlElement getAttribute​(IvmlElement element)
        Returns the attribute specified by element (matches qualified and unqualified names).
        Parameters:
        element - the IvmlElement denoting the attribute
        Returns:
        the matching attribute or null
      • getAnnotation

        public IvmlElement getAnnotation​(java.lang.String name)
        Returns the attribute specified by name (matches qualified and unqualified names).
        Parameters:
        name - the name of the element (no regex)
        Returns:
        the matching attribute or null
      • getAnnotation

        public IvmlElement getAnnotation​(IvmlElement element)
        Returns the attribute specified by element (matches qualified and unqualified names).
        Parameters:
        element - the IvmlElement denoting the attribute
        Returns:
        the matching attribute or null
      • isValid

        public boolean isValid()
        Returns whether this element is valid.
        Returns:
        true if this element is valid, false else
        See Also:
        VariableValueMapping#getValidFlag(AbstractIvmlVariable)
      • isEnacting

        public boolean isEnacting()
        Returns whether this element is currently enacting.
        Returns:
        true if this currently in enactment, false else
        See Also:
        VariableValueMapping#getValidFlag(AbstractIvmlVariable)
      • isNull

        public boolean isNull()
        Returns whether the value of this element is null (in the semantics of IVML). This does not mean undefined!
        Returns:
        true if the value is null, false else
      • getValue

        public abstract java.lang.Object getValue()
        Returns the (untyped) value of the decision variable.
        Returns:
        the value (may be null)
      • getStringValue

        public abstract java.lang.String getStringValue()
        Returns the string value of the decision variable.
        Returns:
        the value (may be null)
      • getIntegerValue

        public abstract java.lang.Integer getIntegerValue()
        Returns the integer value of the decision variable.
        Returns:
        the value (may be null)
      • getRealValue

        public abstract java.lang.Double getRealValue()
        Returns the real value of the decision variable.
        Returns:
        the value (may be null)
      • getBooleanValue

        public abstract java.lang.Boolean getBooleanValue()
        Returns the boolean value of the decision variable.
        Returns:
        the value (may be null)
      • getEnumValue

        public abstract EnumValue getEnumValue()
        Returns the boolean value of the decision variable.
        Returns:
        the value (may be null)
      • getElement

        public abstract IvmlElement getElement​(java.lang.String name)
        Returns the element matching the given (qualified) name.
        Parameters:
        name - the name to search for
        Returns:
        the matching element or null if not found
      • search

        protected IvmlElement search​(java.lang.String name,
                                     IvmlElement[] elements)
        Searches for an element denoted by name in elements.
        Parameters:
        name - the element to search for
        elements - the elements to search within
        Returns:
        the found element or null
      • checkElement

        protected IvmlElement checkElement​(java.lang.String name,
                                           IvmlElement element)
        Checks the given element for equality and performs (if required) deeper search using getElement(String).
        Parameters:
        name - the element to search for
        element - the element to search within
        Returns:
        the found element or null
      • equals

        public static boolean equals​(IvmlElement i1,
                                     IvmlElement i2)
        Represents the equality operation for IvmlElements.
        Parameters:
        i1 - the first element to be considered
        i2 - the second element to be considered
        Returns:
        i1 == i2
      • equals2

        public static boolean equals2​(IvmlElement i1,
                                      java.lang.Object i2)
        Represents the equality operation for IvmlElements and AnyType, in particular the null value.
        Parameters:
        i1 - the first element to be considered
        i2 - the second element to be considered
        Returns:
        i1 == i2
      • unequals

        public static boolean unequals​(IvmlElement i1,
                                       IvmlElement i2)
        Represents the unequality operation for IvmlElements.
        Parameters:
        i1 - the first element to be considered
        i2 - the second element to be considered
        Returns:
        i1 == i2
      • unequals2

        public static boolean unequals2​(IvmlElement i1,
                                        java.lang.Object i2)
        Represents the unequality operation for IvmlElements and AnyTypes, in particular the null value.
        Parameters:
        i1 - the first element to be considered
        i2 - the second element to be considered
        Returns:
        i1 == i2
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns the string value of this object.
        Specified by:
        getStringValue in interface IStringValueProvider
        Parameters:
        comparator - if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned
        Returns:
        the string value
      • getInstanceName

        public java.lang.String getInstanceName()
        Returns the instance name of this element.
        Returns:
        the instance name
      • getTypeDescriptor

        static TypeDescriptor<?> getTypeDescriptor​(IDatatype type)
        Returns the type descriptor for a given IVML datatype. May lead to a fake/fallback datatype if not known / advised.
        Parameters:
        type - the type
        Returns:
        the type or null if unknown