Class CIValue

  • All Implemented Interfaces:
    java.lang.Comparable<CIValue>
    Direct Known Subclasses:
    CILevelValue

    @API(type=EXTENDABLE,
         src=PRIVATE)
    public class CIValue
    extends java.lang.Object
    implements java.lang.Comparable<CIValue>
    Interface for objects holding information about element or attribute values used in the content completion process.
    • Constructor Summary

      Constructors 
      Constructor Description
      CIValue​(java.lang.String value)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue, java.lang.String annotation)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue, java.lang.String annotation, boolean defaultValue)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue, java.lang.String annotation, java.lang.String insertString, int type)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue, java.lang.String annotation, java.lang.String insertString, int type, boolean defaultValue)
      Creates a CIValue.
      CIValue​(java.lang.String value, boolean listValue, java.lang.String annotation, java.lang.String insertString, int type, boolean defaultValue, int afterInsertCaretPosition)
      Creates a CIValue.
      CIValue​(java.lang.String value, java.lang.String annotation)
      Creates a CIValue.
      CIValue​(java.lang.String value, java.lang.String annotation, int type)
      Creates a CIValue.
      CIValue​(java.lang.String fullPrefix, CIValue ciValue)
      Create a CIValue from another one by adding a prefix to the original value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CIValue other)
      Compares the String values.
      boolean equals​(java.lang.Object obj)
      Test if a CIValue is equal with this one.
      int getAfterInsertCaretPosition()
      Get the relative position where to place the caret after the value is inserted.
      java.lang.String getAnnotation()
      Get the annotation associated with this value.
      java.lang.String getAnnotationAsPlainText()
      Get the annotation associated with this value.
      static CIValue[] getCIFromIDValues​(java.util.Collection<ro.sync.xml.parser.IDValue> values, boolean multipleValue)
      Utility method to get an array of CIValue from a list of strings.
      static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values)
      Utility method to get an array of CIValue from a list of strings.
      static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values, int type)
      Utility method to get an array of CIValue from a list of strings.
      static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values, int type, boolean listValue)
      Utility method to get an array of CIValue from a list of strings.
      static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values, int type, boolean listValue, boolean addDollar)
      Utility method to get an array of CIValue from a list of strings.
      static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values)
      Get a list of CIValue from a list of strings.
      static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values, java.lang.String defaultValue)
      Get a list of CIValue from a list of strings.
      static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values, java.lang.String defaultValue, int type)
      Get a list of CIValue from a list of strings.
      java.lang.String getInsertString()
      Get the insert string.
      int getType()
      Get the type of the value.
      java.lang.String getValue()
      Get the actual value as detected in the associated schema.
      int hashCode()  
      boolean isDefaultValue()
      Get the default value flag.
      boolean isListValue()
      Check if the value is an entry in a list value.
      protected boolean isUsedInURLAnchors()  
      void setAfterInsertCaretPosition​(int afterInsertCaretPosition)
      Set the relative position where to place the caret after the value is inserted.
      void setAnnotation​(java.lang.String annotation)
      Set the annotation associated with this value.
      void setDefaultValue()
      Mark the value as default value.
      void setInsertString​(java.lang.String insertString)
      Sets the insert string.
      void setListValue()
      Mark the value as belonging to a list value.
      void setType​(int type)
      Set the value type.
      void setValue​(java.lang.String value)
      Sets the value.
      java.lang.String toString()
      Get a String representation of this CIValue.
      java.lang.Object valueOf​(java.lang.String str)
      IMPORTANT DO NOT DELETE! This is needed by a combo box editor to see if it is the same value as the old one.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • afterInsertCaretPosition

        protected int afterInsertCaretPosition
        The position in text where to place the caret position after insert value. If value is -1, then the caret position is not and must be computed.
      • TYPE_PLAIN

        public static final int TYPE_PLAIN
        Marks that the value is a plain text value with no additional meaning. The value is 0
        See Also:
        Constant Field Values
      • TYPE_XSLT_AXIS

        public static final int TYPE_XSLT_AXIS
        Marks that the value represents an axis in XSLT. The value is 1
        See Also:
        Constant Field Values
      • TYPE_XSLT_FUNCTION

        public static final int TYPE_XSLT_FUNCTION
        Marks that the value represents an XSLT function. The value is 2
        See Also:
        Constant Field Values
      • TYPE_XSLT_ELEMENT

        public static final int TYPE_XSLT_ELEMENT
        Marks that the value represents a name of an element from the document. The value is 3
        See Also:
        Constant Field Values
      • TYPE_XSLT_ATTRIBUTE

        public static final int TYPE_XSLT_ATTRIBUTE
        Marks that the value represents a name of an attribute from the document. The value is 4
        See Also:
        Constant Field Values
      • TYPE_FOLDER

        public static final int TYPE_FOLDER
        Marks that the value represents a name of a folder. The value is 5
        See Also:
        Constant Field Values
      • TYPE_FILE_NAME

        public static final int TYPE_FILE_NAME
        Marks that the value represents a name of a file. The value is 6
        See Also:
        Constant Field Values
      • TYPE_UNKNOWN

        public static final int TYPE_UNKNOWN
        Marks that value represents either a name of a file or a name of a folder, but it cannot be easily established because of a very time-consuming operation involved. The value is 7
        See Also:
        Constant Field Values
      • TYPE_ANT_PROPERTY

        public static final int TYPE_ANT_PROPERTY
        Marks that the value represents an Ant property. The value is 8
        See Also:
        Constant Field Values
      • TYPE_ANT_TARGET

        public static final int TYPE_ANT_TARGET
        Marks that the value represents an Ant target. The value is 9
        See Also:
        Constant Field Values
      • TYPE_ANT_EXTENSION_POINT

        public static final int TYPE_ANT_EXTENSION_POINT
        Marks that the value represents an Ant extension-point. The value is 10
        See Also:
        Constant Field Values
      • TYPE_ANT_REFERENCE

        public static final int TYPE_ANT_REFERENCE
        Marks that the value represents an Ant reference. The value is 11
        See Also:
        Constant Field Values
      • TYPE_XSLT_PARAM

        public static final int TYPE_XSLT_PARAM
        Marks that the value represents a XSLT param. The value is 12
        See Also:
        Constant Field Values
      • TYPE_XSLT_MODE

        public static final int TYPE_XSLT_MODE
        Marks that the value represents a XSLT mode. The value is 13
        See Also:
        Constant Field Values
      • TYPE_XSLT_TEMPLATE

        public static final int TYPE_XSLT_TEMPLATE
        Marks that the value represents a XSLT template. The value is 14
        See Also:
        Constant Field Values
      • TYPE_XSLT_KEY

        public static final int TYPE_XSLT_KEY
        Marks that the value represents a XSLT key. The value is 15
        See Also:
        Constant Field Values
      • TYPE_XSLT_OUTPUT

        public static final int TYPE_XSLT_OUTPUT
        Marks that the value represents a XSLT output. The value is 16
        See Also:
        Constant Field Values
      • TYPE_XSLT_ATTRIBUTE_SET

        public static final int TYPE_XSLT_ATTRIBUTE_SET
        Marks that the value represents a XSLT attribute set. The value is 17
        See Also:
        Constant Field Values
      • TYPE_XSLT_CHARACTER_MAP

        public static final int TYPE_XSLT_CHARACTER_MAP
        Marks that the value represents a XSLT character map. The value is 18
        See Also:
        Constant Field Values
      • TYPE_XSLT_VARIABLE

        public static final int TYPE_XSLT_VARIABLE
        Marks that the value represents a XSLT variable. The value is 19
        See Also:
        Constant Field Values
      • TYPE_XSD_COMPLEX_TYPE

        public static final int TYPE_XSD_COMPLEX_TYPE
        Marks that the value represents a XSD complex type. The value is 20
        See Also:
        Constant Field Values
      • TYPE_XSD_SIMPLE_TYPE

        public static final int TYPE_XSD_SIMPLE_TYPE
        Marks that the value represents a XSD simple type. The value is 21
        See Also:
        Constant Field Values
      • TYPE_XSD_ATTRIBUTE

        public static final int TYPE_XSD_ATTRIBUTE
        Marks that the value represents a XSD attribute. The value is 22
        See Also:
        Constant Field Values
      • TYPE_XSD_ATTRIBUTE_GROUP

        public static final int TYPE_XSD_ATTRIBUTE_GROUP
        Marks that the value represents a XSD attribute group. The value is 23
        See Also:
        Constant Field Values
      • TYPE_XSD_ELEMENT

        public static final int TYPE_XSD_ELEMENT
        Marks that the value represents a XSD element. The value is 24
        See Also:
        Constant Field Values
      • TYPE_XSD_NOTATION

        public static final int TYPE_XSD_NOTATION
        Marks that the value represents a XSD notation. The value is 25
        See Also:
        Constant Field Values
      • TYPE_XSD_GROUP

        public static final int TYPE_XSD_GROUP
        Marks that the value represents a XSD group. The value is 26
        See Also:
        Constant Field Values
      • TYPE_XSD_SIMPLE_OR_COMPLEX_TYPE

        public static final int TYPE_XSD_SIMPLE_OR_COMPLEX_TYPE
        Marks that the value represents a XSD simple or complex type. The value is 27
        See Also:
        Constant Field Values
      • TYPE_WSDL_PORT_TYPE_OPERATION

        public static final int TYPE_WSDL_PORT_TYPE_OPERATION
        Marks that the value represents a WSDL port type operation type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_PORT_TYPE

        public static final int TYPE_WSDL_PORT_TYPE
        Marks that the value represents a WSDL port type type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_MESSAGE

        public static final int TYPE_WSDL_MESSAGE
        Marks that the value represents a WSDL message type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_OPERATION_INPUT

        public static final int TYPE_WSDL_OPERATION_INPUT
        Marks that the value represents a WSDL operation input type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_OPERATION_OUTPUT

        public static final int TYPE_WSDL_OPERATION_OUTPUT
        Marks that the value represents a WSDL operation output type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_OPERATION_FAULT

        public static final int TYPE_WSDL_OPERATION_FAULT
        Marks that the value represents a WSDL operation fault type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_BINDING

        public static final int TYPE_WSDL_BINDING
        Marks that the value represents a WSDL binding type.
        See Also:
        Constant Field Values
      • TYPE_WSDL_MESSAGE_PART

        public static final int TYPE_WSDL_MESSAGE_PART
        Marks that the value represents a WSDL message part type.
        See Also:
        Constant Field Values
      • TYPE_XSD_CONSTRAINT

        public static final int TYPE_XSD_CONSTRAINT
        Marks that the value represents a XSD key or unique element.
        See Also:
        Constant Field Values
      • TYPE_SCH_VARIABLE

        public static final int TYPE_SCH_VARIABLE
        Marks that the value represents a schematron variable type.
        See Also:
        Constant Field Values
      • TYPE_SCH_DIAGNOSTIC

        public static final int TYPE_SCH_DIAGNOSTIC
        Marks that the value represents a schematron diagnostic type.
        See Also:
        Constant Field Values
      • TYPE_SCH_PATTERN

        public static final int TYPE_SCH_PATTERN
        Marks that the value represents a schematron pattern type.
        See Also:
        Constant Field Values
      • TYPE_SCH_PHASE

        public static final int TYPE_SCH_PHASE
        Marks that the value represents a schematron phase type.
        See Also:
        Constant Field Values
      • TYPE_SCH_RULE

        public static final int TYPE_SCH_RULE
        Marks that the value represents a schematron rule type.
        See Also:
        Constant Field Values
      • TYPE_XSLT_LOCAL_PARAM

        public static final int TYPE_XSLT_LOCAL_PARAM
        Marks that the value represents an XSLT local parameter.
        See Also:
        Constant Field Values
      • TYPE_XSLT_LOCAL_VARIABLE

        public static final int TYPE_XSLT_LOCAL_VARIABLE
        Marks that the value represents an XSLT local variable.
        See Also:
        Constant Field Values
      • TYPE_SCH_PROPERTY

        public static final int TYPE_SCH_PROPERTY
        Marks that the value represents a schematron property type.
        See Also:
        Constant Field Values
      • TYPE_OXYGEN_XPATH_FUNCTION

        public static final int TYPE_OXYGEN_XPATH_FUNCTION
        Oxygen's custom XPath functions.
        See Also:
        Constant Field Values
      • TYPE_XSLT_ACCUMULATOR

        public static final int TYPE_XSLT_ACCUMULATOR
        XSLT 3.0 Accumulator.
        See Also:
        Constant Field Values
      • TYPE_AI_POSITRON_FUNCTION

        public static final int TYPE_AI_POSITRON_FUNCTION
        AI Positron Functions.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CIValue

        public CIValue​(java.lang.String value)
        Creates a CIValue.
        Parameters:
        value - The actual value.
      • CIValue

        public CIValue​(java.lang.String value,
                       boolean listValue)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        listValue - Flag indicating if the value is an entry from a list value.
      • CIValue

        public CIValue​(java.lang.String value,
                       java.lang.String annotation)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        annotation - The annotation associated with this value.
      • CIValue

        public CIValue​(java.lang.String value,
                       java.lang.String annotation,
                       int type)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        annotation - The annotation associated with this value.
        type - The value type.
      • CIValue

        public CIValue​(java.lang.String value,
                       boolean listValue,
                       java.lang.String annotation)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        listValue - Flag indicating if the value is an entry from a list value.
        annotation - The annotation associated with this value.
      • CIValue

        public CIValue​(java.lang.String value,
                       boolean listValue,
                       java.lang.String annotation,
                       boolean defaultValue)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        listValue - Flag indicating if the value is an entry from a list value.
        annotation - The annotation associated with this value.
        defaultValue - true if it is the default value.
      • CIValue

        public CIValue​(java.lang.String value,
                       boolean listValue,
                       java.lang.String annotation,
                       java.lang.String insertString,
                       int type,
                       boolean defaultValue)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        listValue - Flag indicating if the value is an entry from a list value.
        annotation - The annotation associated with this value.
        insertString - The string to be inserted in the document when the CIValue is chosen from the content completion list of proposals. If null, the value will be used.
        type - The type of the value. Use by the renderer.
        Can be one of the constants: TYPE_PLAIN, TYPE_XSLT_AXIS, TYPE_XSLT_FUNCTION, TYPE_XSLT_ELEMENT, TYPE_XSLT_ATTRIBUTE
        defaultValue - true if it is the default value.
      • CIValue

        public CIValue​(java.lang.String value,
                       boolean listValue,
                       java.lang.String annotation,
                       java.lang.String insertString,
                       int type,
                       boolean defaultValue,
                       int afterInsertCaretPosition)
        Creates a CIValue.
        Parameters:
        value - The actual value.
        listValue - Flag indicating if the value is an entry from a list value.
        annotation - The annotation associated with this value.
        insertString - The string to be inserted in the document when the CIValue is chosen from the content completion list of proposals. If null, the value will be used.
        type - The type of the value. Use by the renderer.
        Can be one of the constants: TYPE_PLAIN, TYPE_XSLT_AXIS, TYPE_XSLT_FUNCTION, TYPE_XSLT_ELEMENT, TYPE_XSLT_ATTRIBUTE
        defaultValue - true if it is the default value.
        afterInsertCaretPosition - The position in text where to place the caret position after insert value. If value is -1, then the caret position is not and must be computed.
      • CIValue

        public CIValue​(java.lang.String fullPrefix,
                       CIValue ciValue)
        Create a CIValue from another one by adding a prefix to the original value.
        Parameters:
        fullPrefix - The full prefix of the value field.
        ciValue - The CIValue to use when creating a new one.
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Get the actual value as detected in the associated schema.
        Returns:
        The value of the CIValue.
      • isListValue

        public boolean isListValue()
        Check if the value is an entry in a list value.
        Returns:
        true if the value is part of a list.
      • setListValue

        public void setListValue()
        Mark the value as belonging to a list value.
      • getAnnotation

        public java.lang.String getAnnotation()
        Get the annotation associated with this value. The annotation is an additional text description (for example documentation) of the value which is usually displayed when the user browses possible values.
        Returns:
        The value annotation.
      • getAnnotationAsPlainText

        public java.lang.String getAnnotationAsPlainText()
        Get the annotation associated with this value. The annotation is an additional text description (for example documentation) of the value which is usually displayed when the user browses possible values. If the annotation contains HTML elements, it will be converted to plain text.
        Returns:
        The value annotation in plain text, with possible HTML tags removed.
      • setAnnotation

        public void setAnnotation​(java.lang.String annotation)
        Set the annotation associated with this value. The annotation is an additional text description (for example documentation) of the value which is usually displayed when the user browses possible values.
        Parameters:
        annotation - The value annotation.
      • getCIValues

        public static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values)
        Utility method to get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.
        Parameters:
        values - A collection of String values.
        Returns:
        An array of CIValues.
      • getCIValues

        public static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values,
                                            int type)
        Utility method to get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.
        Parameters:
        values - A collection of String values.
        type - The type of value.
        Returns:
        An array of CIValues.
      • getCIValues

        public static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values,
                                            int type,
                                            boolean listValue)
        Utility method to get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.
        Parameters:
        values - A collection of String values.
        type - The type of value.
        listValue - true if the values must be marked as belonging to a list.
        Returns:
        An array of CIValues.
      • getCIValues

        public static CIValue[] getCIValues​(java.util.Collection<java.lang.String> values,
                                            int type,
                                            boolean listValue,
                                            boolean addDollar)
        Utility method to get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.
        Parameters:
        values - A collection of String values.
        type - The type of value.
        listValue - true if the values must be marked as belonging to a list.
        addDollar - If true the $ sign must be added.
        Returns:
        An array of CIValues.
      • getCIFromIDValues

        public static CIValue[] getCIFromIDValues​(java.util.Collection<ro.sync.xml.parser.IDValue> values,
                                                  boolean multipleValue)
        Utility method to get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.
        Parameters:
        values - A collection of String values.
        multipleValue - true if the value allows multiple values.
        Returns:
        An array of CIValues.
      • getCIValuesAsList

        public static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values)
        Get a list of CIValue from a list of strings. Assumes no annotation and no list types are present.
        Parameters:
        values - A collection of String values.
        Returns:
        An new list of CIValues.
      • getCIValuesAsList

        public static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values,
                                                                java.lang.String defaultValue)
        Get a list of CIValue from a list of strings. Assumes no annotation and no list types are present.
        Parameters:
        values - A collection of String values.
        defaultValue - The default value
        Returns:
        An new list of CIValues.
      • getCIValuesAsList

        public static java.util.List<CIValue> getCIValuesAsList​(java.util.Collection<java.lang.String> values,
                                                                java.lang.String defaultValue,
                                                                int type)
        Get a list of CIValue from a list of strings. Assumes no annotation and no list types are present.
        Parameters:
        values - A collection of String values.
        defaultValue - The default value
        type - The value type.
        Returns:
        An new list of CIValues.
      • equals

        public boolean equals​(java.lang.Object obj)
        Test if a CIValue is equal with this one.
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • isDefaultValue

        public boolean isDefaultValue()
        Get the default value flag.
        Returns:
        True if the value is marked as default.
      • setDefaultValue

        public void setDefaultValue()
        Mark the value as default value.
      • toString

        public java.lang.String toString()
        Get a String representation of this CIValue.
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • compareTo

        public int compareTo​(CIValue other)
        Compares the String values.
        Specified by:
        compareTo in interface java.lang.Comparable<CIValue>
        See Also:
        Comparable.compareTo(java.lang.Object)
      • isUsedInURLAnchors

        protected boolean isUsedInURLAnchors()
        Returns:
        true if the ID is used in an URL anchor
      • getInsertString

        public java.lang.String getInsertString()
        Get the insert string. It represents an escaped version of the value and can be inserted directly in the document.
        Returns:
        The escaped value to be inserted in the document.
      • setInsertString

        public void setInsertString​(java.lang.String insertString)
        Sets the insert string. It is taken into consideration only in the Text page.
        Parameters:
        insertString - The value to be inserted in the document.
      • valueOf

        public java.lang.Object valueOf​(java.lang.String str)
        IMPORTANT DO NOT DELETE! This is needed by a combo box editor to see if it is the same value as the old one.
        Parameters:
        str - The str.
        Returns:
        The same object.
      • getAfterInsertCaretPosition

        public int getAfterInsertCaretPosition()
        Get the relative position where to place the caret after the value is inserted.
        Returns:
        The position to place the caret after inserting the string. If -1 the caret position was not computed.
      • setAfterInsertCaretPosition

        public void setAfterInsertCaretPosition​(int afterInsertCaretPosition)
        Set the relative position where to place the caret after the value is inserted.
        Parameters:
        afterInsertCaretPosition - The afterInsertCaretPosition to set.
      • setValue

        public void setValue​(java.lang.String value)
        Sets the value.
        Parameters:
        value - The new value.
      • setType

        public void setType​(int type)
        Set the value type.
        Parameters:
        type - The value type.