Class WhatPossibleValuesHasAttributeContext

  • All Implemented Interfaces:
    java.lang.Cloneable

    @API(type=EXTENDABLE,
         src=PRIVATE)
    public class WhatPossibleValuesHasAttributeContext
    extends ro.sync.contentcompletion.xml.WhatContextInParent
    It is used to determine the possible values of the current attribute.
    • Constructor Detail

      • WhatPossibleValuesHasAttributeContext

        public WhatPossibleValuesHasAttributeContext()
    • Method Detail

      • getAttributeName

        public java.lang.String getAttributeName()
        Gets the name of the attribute, including the namespace prefix, if any.
        Returns:
        The attribute name.
      • setAttributeName

        public void setAttributeName​(java.lang.String attributeName)
        Sets the attribute name, including the namespace prefix, if any.
        Parameters:
        attributeName - The attribute name.
      • getAttributeValue

        public java.lang.String getAttributeValue()
        Gets the Value of the attribute, if any.
        Returns:
        The attribute value.
      • setAttributeValue

        public void setAttributeValue​(java.lang.String attributeValue)
        Sets the existing attribute value, if any.
        Parameters:
        attributeValue - The attribute value.
      • toString

        public java.lang.String toString()
        Get a description of the current context.
        Overrides:
        toString in class ro.sync.contentcompletion.xml.WhatContextInParent
        Returns:
        A string containing information about the current context: attribute name, parent element qualified name, parent element type, element stack.
        See Also:
        Object.toString()
      • getGrandparentAttributes

        public Attribute[] getGrandparentAttributes()
        Get the grandparent's attributes.
        Returns:
        The grandparent attributes.
      • getGrandparentElement

        public java.lang.String getGrandparentElement()
        Get the qualified name of the grand parent element.
        Returns:
        The name of the attribute grandparent element.
        Throws:
        java.util.EmptyStackException - In case the stack is empty.
      • getGrandparentNamespace

        public java.lang.String getGrandparentNamespace()
        Get the namespace of the grand parent element.
        Returns:
        The element namespace for the element that is the grandparent of the current attribute.
        Throws:
        java.util.EmptyStackException - In case the stack is empty.
      • getAncestorValues

        public java.util.List<java.lang.String> getAncestorValues​(java.lang.String name,
                                                                  java.lang.String namespace,
                                                                  java.lang.String attribute)
        Get the values of the specified (by name) attribute from the ancestors with the given name and namespace.
        Parameters:
        name - The name of the element where the attribute must be searched.
        namespace - The namespace of the element where the attribute must be searched.
        attribute - The attribute local name.
        Returns:
        A list of attribute values, never null.
      • getCurrentValuePrefix

        public java.lang.String getCurrentValuePrefix()
        Get the already inserted value prefix.
        Returns:
        The text from the start position of the attribute value and the caret position. Can be null if no prefix was found.
      • setCurrentValuePrefix

        public void setCurrentValuePrefix​(java.lang.String currentValuePrefix)
        Set the the already inserted value prefix. For instance, if having starting the CC at the position "|"
         test="element/na|"
         
        Then the value returned is "element/na".
        Parameters:
        currentValuePrefix - The text from the start position of the attribute value and the caret position.
      • getCurrentValueBeforeActivationChar

        public java.lang.String getCurrentValueBeforeActivationChar()
        Get the existing attribute value before the activation char. For instance, if having starting the CC at the position "|"
         
         
        Then the value returned is "element".
        Returns:
        Returns the current attribute value before the activation char.
      • setCurrentValueBeforeActivationChar

        public void setCurrentValueBeforeActivationChar​(java.lang.String currentValueBeforeActivationChar)
        Set the current attribute value before the activation character
        Parameters:
        currentValueBeforeActivationChar -
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class ro.sync.contentcompletion.xml.WhatContextInParent
        See Also:
        WhatContextInParent.clone()
      • getDefaultAttributeValue

        public java.lang.String getDefaultAttributeValue()
        Returns:
        The default value of the attribute in the associated schema.