Class ComputedAttributeConstructorExpression

java.lang.Object
org.rumbledb.expressions.Node
org.rumbledb.expressions.Expression
org.rumbledb.expressions.xml.ComputedAttributeConstructorExpression

public class ComputedAttributeConstructorExpression extends Expression
Expression representing a computed attribute constructor.
See Also:
  • Constructor Details

    • ComputedAttributeConstructorExpression

      public ComputedAttributeConstructorExpression(Name attributeName, Expression valueExpression, ExceptionMetadata metadata)
      Constructor for static attribute name: attribute attributeName { value }
      Parameters:
      attributeName - The static attribute name
      valueExpression - The value expression
      metadata - The exception metadata
    • ComputedAttributeConstructorExpression

      public ComputedAttributeConstructorExpression(Expression nameExpression, Expression valueExpression, ExceptionMetadata metadata)
      Constructor for dynamic attribute name: attribute { nameExpression } { value }
      Parameters:
      nameExpression - The dynamic attribute name expression
      valueExpression - The value expression
      metadata - The exception metadata
  • Method Details

    • getAttributeName

      public Name getAttributeName()
      Get the static attribute name
      Returns:
      The static attribute name
    • getNameExpression

      public Expression getNameExpression()
      Get the dynamic attribute name expression
      Returns:
      The dynamic attribute name expression
    • getValueExpression

      public Expression getValueExpression()
      Get the value expression
      Returns:
      The value expression
    • hasStaticName

      public boolean hasStaticName()
      Check if the attribute has a static name
      Returns:
      True if the attribute has a static name, false otherwise
    • accept

      public <T> T accept(AbstractNodeVisitor<T> visitor, T argument)
      Description copied from class: Node
      Accept method for the visitor pattern.
      Specified by:
      accept in class Node
      Type Parameters:
      T - the type of the objects returned by the visitor.
      Parameters:
      visitor - the visitor.
      argument - the input from the visitor.
      Returns:
      the object returned by this visitor
    • getChildren

      public List<Node> getChildren()
      Description copied from class: Node
      Returns all children nodes as a list. The list is new and can be modified at will by the caller.
      Specified by:
      getChildren in class Node
      Returns:
      the children nodes as a list.
    • serializeToJSONiq

      public void serializeToJSONiq(StringBuffer sb, int indent)
      Specified by:
      serializeToJSONiq in class Node