Package ro.sync.contentcompletion.xml
Class CIValue
java.lang.Object
ro.sync.contentcompletion.xml.CIValue
- All Implemented Interfaces:
Comparable<CIValue>
- Direct Known Subclasses:
CILevelValue
@API(type=EXTENDABLE,
src=PRIVATE)
public class CIValue
extends Object
implements Comparable<CIValue>
Interface for objects holding information about element or attribute values
used in the content completion process.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The position in text where to place the caret position after insert value.static final int
AI Positron Functions.static final int
Marks that the value represents an Ant extension-point.static final int
Marks that the value represents an Ant property.static final int
Marks that the value represents an Ant reference.static final int
Marks that the value represents an Ant target.static final int
Marks that the value represents a name of a file.static final int
Marks that the value represents a name of a folder.static final int
Oxygen's custom XPath functions.static final int
Marks that the value is a plain text value with no additional meaning.static final int
Marks that the value represents a schematron diagnostic type.static final int
Marks that the value represents a schematron pattern type.static final int
Marks that the value represents a schematron phase type.static final int
Marks that the value represents a schematron property type.static final int
Marks that the value represents a schematron rule type.static final int
Marks that the value represents a schematron variable type.static final int
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.static final int
Marks that the value represents a WSDL binding type.static final int
Marks that the value represents a WSDL message type.static final int
Marks that the value represents a WSDL message part type.static final int
Marks that the value represents a WSDL operation fault type.static final int
Marks that the value represents a WSDL operation input type.static final int
Marks that the value represents a WSDL operation output type.static final int
Marks that the value represents a WSDL port type type.static final int
Marks that the value represents a WSDL port type operation type.static final int
Marks that the value represents a XSD attribute.static final int
Marks that the value represents a XSD attribute group.static final int
Marks that the value represents a XSD complex type.static final int
Marks that the value represents a XSD key or unique element.static final int
Marks that the value represents a XSD element.static final int
Marks that the value represents a XSD group.static final int
Marks that the value represents a XSD notation.static final int
Marks that the value represents a XSD simple or complex type.static final int
Marks that the value represents a XSD simple type.static final int
XSLT 3.0 Accumulator.static final int
Marks that the value represents a name of an attribute from the document.static final int
Marks that the value represents a XSLT attribute set.static final int
Marks that the value represents an axis in XSLT.static final int
Marks that the value represents a XSLT character map.static final int
Marks that the value represents a name of an element from the document.static final int
Marks that the value represents an XSLT function.static final int
Marks that the value represents a XSLT key.static final int
Marks that the value represents an XSLT local parameter.static final int
Marks that the value represents an XSLT local variable.static final int
Marks that the value represents a XSLT mode.static final int
Marks that the value represents a XSLT output.static final int
Marks that the value represents a XSLT param.static final int
Marks that the value represents a XSLT template.static final int
Marks that the value represents a XSLT variable. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a CIValue.Creates a CIValue.Creates a CIValue.Creates a CIValue.Creates a CIValue.CIValue
(String value, boolean listValue, String annotation, String insertString, int type, boolean defaultValue) Creates a CIValue.CIValue
(String value, boolean listValue, String annotation, String insertString, int type, boolean defaultValue, int afterInsertCaretPosition) Creates a CIValue.Creates a CIValue.Creates a CIValue.Create a CIValue from another one by adding a prefix to the original value. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares the String values.boolean
Test if aCIValue
is equal with this one.int
Get the relative position where to place the caret after the value is inserted.Get the annotation associated with this value.Get the annotation associated with this value.static CIValue[]
getCIFromIDValues
(Collection<ro.sync.xml.parser.IDValue> values, boolean multipleValue) Utility method to get an array ofCIValue
from a list of strings.static CIValue[]
getCIValues
(Collection<String> values) Utility method to get an array ofCIValue
from a list of strings.static CIValue[]
getCIValues
(Collection<String> values, int type) Utility method to get an array ofCIValue
from a list of strings.static CIValue[]
getCIValues
(Collection<String> values, int type, boolean listValue) Utility method to get an array ofCIValue
from a list of strings.static CIValue[]
getCIValues
(Collection<String> values, int type, boolean listValue, boolean addDollar) Utility method to get an array ofCIValue
from a list of strings.getCIValuesAsList
(Collection<String> values) Get a list ofCIValue
from a list of strings.getCIValuesAsList
(Collection<String> values, String defaultValue) Get a list ofCIValue
from a list of strings.getCIValuesAsList
(Collection<String> values, String defaultValue, int type) Get a list ofCIValue
from a list of strings.Get the insert string.int
getType()
Get the type of the value.getValue()
Get the actual value as detected in the associated schema.int
hashCode()
boolean
Get the default value flag.boolean
Check if the value is an entry in a list value.protected boolean
void
setAfterInsertCaretPosition
(int afterInsertCaretPosition) Set the relative position where to place the caret after the value is inserted.void
setAnnotation
(String annotation) Set the annotation associated with this value.void
Mark the value as default value.void
setInsertString
(String insertString) Sets the insert string.void
Mark the value as belonging to a list value.void
setType
(int type) Set the value type.void
Sets the value.toString()
Get a String representation of thisCIValue
.IMPORTANT DO NOT DELETE! This is needed by a combo box editor to see if it is the same value as the old one.
-
Field Details
-
afterInsertCaretPosition
protected int afterInsertCaretPositionThe 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_PLAINMarks that the value is a plain text value with no additional meaning. The value is0
- See Also:
-
TYPE_XSLT_AXIS
public static final int TYPE_XSLT_AXISMarks that the value represents an axis in XSLT. The value is1
- See Also:
-
TYPE_XSLT_FUNCTION
public static final int TYPE_XSLT_FUNCTIONMarks that the value represents an XSLT function. The value is2
- See Also:
-
TYPE_XSLT_ELEMENT
public static final int TYPE_XSLT_ELEMENTMarks that the value represents a name of an element from the document. The value is3
- See Also:
-
TYPE_XSLT_ATTRIBUTE
public static final int TYPE_XSLT_ATTRIBUTEMarks that the value represents a name of an attribute from the document. The value is4
- See Also:
-
TYPE_FOLDER
public static final int TYPE_FOLDERMarks that the value represents a name of a folder. The value is5
- See Also:
-
TYPE_FILE_NAME
public static final int TYPE_FILE_NAMEMarks that the value represents a name of a file. The value is6
- See Also:
-
TYPE_UNKNOWN
public static final int TYPE_UNKNOWNMarks 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 is7
- See Also:
-
TYPE_ANT_PROPERTY
public static final int TYPE_ANT_PROPERTYMarks that the value represents an Ant property. The value is8
- See Also:
-
TYPE_ANT_TARGET
public static final int TYPE_ANT_TARGETMarks that the value represents an Ant target. The value is9
- See Also:
-
TYPE_ANT_EXTENSION_POINT
public static final int TYPE_ANT_EXTENSION_POINTMarks that the value represents an Ant extension-point. The value is10
- See Also:
-
TYPE_ANT_REFERENCE
public static final int TYPE_ANT_REFERENCEMarks that the value represents an Ant reference. The value is11
- See Also:
-
TYPE_XSLT_PARAM
public static final int TYPE_XSLT_PARAMMarks that the value represents a XSLT param. The value is12
- See Also:
-
TYPE_XSLT_MODE
public static final int TYPE_XSLT_MODEMarks that the value represents a XSLT mode. The value is13
- See Also:
-
TYPE_XSLT_TEMPLATE
public static final int TYPE_XSLT_TEMPLATEMarks that the value represents a XSLT template. The value is14
- See Also:
-
TYPE_XSLT_KEY
public static final int TYPE_XSLT_KEYMarks that the value represents a XSLT key. The value is15
- See Also:
-
TYPE_XSLT_OUTPUT
public static final int TYPE_XSLT_OUTPUTMarks that the value represents a XSLT output. The value is16
- See Also:
-
TYPE_XSLT_ATTRIBUTE_SET
public static final int TYPE_XSLT_ATTRIBUTE_SETMarks that the value represents a XSLT attribute set. The value is17
- See Also:
-
TYPE_XSLT_CHARACTER_MAP
public static final int TYPE_XSLT_CHARACTER_MAPMarks that the value represents a XSLT character map. The value is18
- See Also:
-
TYPE_XSLT_VARIABLE
public static final int TYPE_XSLT_VARIABLEMarks that the value represents a XSLT variable. The value is19
- See Also:
-
TYPE_XSD_COMPLEX_TYPE
public static final int TYPE_XSD_COMPLEX_TYPEMarks that the value represents a XSD complex type. The value is20
- See Also:
-
TYPE_XSD_SIMPLE_TYPE
public static final int TYPE_XSD_SIMPLE_TYPEMarks that the value represents a XSD simple type. The value is21
- See Also:
-
TYPE_XSD_ATTRIBUTE
public static final int TYPE_XSD_ATTRIBUTEMarks that the value represents a XSD attribute. The value is22
- See Also:
-
TYPE_XSD_ATTRIBUTE_GROUP
public static final int TYPE_XSD_ATTRIBUTE_GROUPMarks that the value represents a XSD attribute group. The value is23
- See Also:
-
TYPE_XSD_ELEMENT
public static final int TYPE_XSD_ELEMENTMarks that the value represents a XSD element. The value is24
- See Also:
-
TYPE_XSD_NOTATION
public static final int TYPE_XSD_NOTATIONMarks that the value represents a XSD notation. The value is25
- See Also:
-
TYPE_XSD_GROUP
public static final int TYPE_XSD_GROUPMarks that the value represents a XSD group. The value is26
- See Also:
-
TYPE_XSD_SIMPLE_OR_COMPLEX_TYPE
public static final int TYPE_XSD_SIMPLE_OR_COMPLEX_TYPEMarks that the value represents a XSD simple or complex type. The value is27
- See Also:
-
TYPE_WSDL_PORT_TYPE_OPERATION
public static final int TYPE_WSDL_PORT_TYPE_OPERATIONMarks that the value represents a WSDL port type operation type.- See Also:
-
TYPE_WSDL_PORT_TYPE
public static final int TYPE_WSDL_PORT_TYPEMarks that the value represents a WSDL port type type.- See Also:
-
TYPE_WSDL_MESSAGE
public static final int TYPE_WSDL_MESSAGEMarks that the value represents a WSDL message type.- See Also:
-
TYPE_WSDL_OPERATION_INPUT
public static final int TYPE_WSDL_OPERATION_INPUTMarks that the value represents a WSDL operation input type.- See Also:
-
TYPE_WSDL_OPERATION_OUTPUT
public static final int TYPE_WSDL_OPERATION_OUTPUTMarks that the value represents a WSDL operation output type.- See Also:
-
TYPE_WSDL_OPERATION_FAULT
public static final int TYPE_WSDL_OPERATION_FAULTMarks that the value represents a WSDL operation fault type.- See Also:
-
TYPE_WSDL_BINDING
public static final int TYPE_WSDL_BINDINGMarks that the value represents a WSDL binding type.- See Also:
-
TYPE_WSDL_MESSAGE_PART
public static final int TYPE_WSDL_MESSAGE_PARTMarks that the value represents a WSDL message part type.- See Also:
-
TYPE_XSD_CONSTRAINT
public static final int TYPE_XSD_CONSTRAINTMarks that the value represents a XSD key or unique element.- See Also:
-
TYPE_SCH_VARIABLE
public static final int TYPE_SCH_VARIABLEMarks that the value represents a schematron variable type.- See Also:
-
TYPE_SCH_DIAGNOSTIC
public static final int TYPE_SCH_DIAGNOSTICMarks that the value represents a schematron diagnostic type.- See Also:
-
TYPE_SCH_PATTERN
public static final int TYPE_SCH_PATTERNMarks that the value represents a schematron pattern type.- See Also:
-
TYPE_SCH_PHASE
public static final int TYPE_SCH_PHASEMarks that the value represents a schematron phase type.- See Also:
-
TYPE_SCH_RULE
public static final int TYPE_SCH_RULEMarks that the value represents a schematron rule type.- See Also:
-
TYPE_XSLT_LOCAL_PARAM
public static final int TYPE_XSLT_LOCAL_PARAMMarks that the value represents an XSLT local parameter.- See Also:
-
TYPE_XSLT_LOCAL_VARIABLE
public static final int TYPE_XSLT_LOCAL_VARIABLEMarks that the value represents an XSLT local variable.- See Also:
-
TYPE_SCH_PROPERTY
public static final int TYPE_SCH_PROPERTYMarks that the value represents a schematron property type.- See Also:
-
TYPE_OXYGEN_XPATH_FUNCTION
public static final int TYPE_OXYGEN_XPATH_FUNCTIONOxygen's custom XPath functions.- See Also:
-
TYPE_XSLT_ACCUMULATOR
public static final int TYPE_XSLT_ACCUMULATORXSLT 3.0 Accumulator.- See Also:
-
TYPE_AI_POSITRON_FUNCTION
public static final int TYPE_AI_POSITRON_FUNCTIONAI Positron Functions.- See Also:
-
-
Constructor Details
-
CIValue
Creates a CIValue.- Parameters:
value
- The actual value.
-
CIValue
Creates a CIValue.- Parameters:
value
- The actual value.listValue
- Flag indicating if the value is an entry from a list value.
-
CIValue
Creates a CIValue.- Parameters:
value
- The actual value.annotation
- The annotation associated with this value.
-
CIValue
Creates a CIValue.- Parameters:
value
- The actual value.annotation
- The annotation associated with this value.type
- The value type.
-
CIValue
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
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
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. Ifnull
, thevalue
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
,TYPE_ANT_EXTENSION_POINT
,TYPE_ANT_PROPERTY
,TYPE_ANT_REFERENCE
,TYPE_ANT_TARGET
.
-
CIValue
public CIValue(String value, boolean listValue, String annotation, 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. Ifnull
, thevalue
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(String value, boolean listValue, String annotation, 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. Ifnull
, thevalue
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
Create a CIValue from another one by adding a prefix to the original value.- Parameters:
fullPrefix
- The full prefix of thevalue
field.ciValue
- The CIValue to use when creating a new one.
-
-
Method Details
-
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
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
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
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
Utility method to get an array ofCIValue
from a list of strings. Assumes no annotations and no list types are present.- Parameters:
values
- A collection ofString
values.- Returns:
- An array of CIValues.
-
getCIValues
Utility method to get an array ofCIValue
from a list of strings. Assumes no annotations and no list types are present.- Parameters:
values
- A collection ofString
values.type
- The type of value.- Returns:
- An array of CIValues.
-
getCIValues
Utility method to get an array ofCIValue
from a list of strings. Assumes no annotations and no list types are present.- Parameters:
values
- A collection ofString
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(Collection<String> values, int type, boolean listValue, boolean addDollar) Utility method to get an array ofCIValue
from a list of strings. Assumes no annotations and no list types are present.- Parameters:
values
- A collection ofString
values.type
- The type of value.listValue
-true
if the values must be marked as belonging to a list.addDollar
- Iftrue
the $ sign must be added.- Returns:
- An array of CIValues.
-
getCIFromIDValues
public static CIValue[] getCIFromIDValues(Collection<ro.sync.xml.parser.IDValue> values, boolean multipleValue) Utility method to get an array ofCIValue
from a list of strings. Assumes no annotations and no list types are present.- Parameters:
values
- A collection ofString
values.multipleValue
-true
if the value allows multiple values.- Returns:
- An array of CIValues.
-
getCIValuesAsList
Get a list ofCIValue
from a list of strings. Assumes no annotation and no list types are present.- Parameters:
values
- A collection ofString
values.- Returns:
- An new list of
CIValues
.
-
getCIValuesAsList
Get a list ofCIValue
from a list of strings. Assumes no annotation and no list types are present.- Parameters:
values
- A collection ofString
values.defaultValue
- The default value- Returns:
- An new list of
CIValues
.
-
getCIValuesAsList
public static List<CIValue> getCIValuesAsList(Collection<String> values, String defaultValue, int type) Get a list ofCIValue
from a list of strings. Assumes no annotation and no list types are present.- Parameters:
values
- A collection ofString
values.defaultValue
- The default valuetype
- The value type.- Returns:
- An new list of
CIValues
.
-
equals
Test if aCIValue
is equal with this one. -
hashCode
public int 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
Get a String representation of thisCIValue
. -
compareTo
Compares the String values.- Specified by:
compareTo
in interfaceComparable<CIValue>
- See Also:
-
isUsedInURLAnchors
protected boolean isUsedInURLAnchors()- Returns:
true
if the ID is used in an URL anchor
-
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
Sets the insert string. It is taken into consideration only in the Text page.- Parameters:
insertString
- The value to be inserted in the document.
-
getType
public int getType()Get the type of the value. It may be plain text value, an axe or a function in xslt or an element from the input document involved in an transformation scenario.- Returns:
- The value type. Can be one of:
TYPE_PLAIN
,TYPE_XSLT_AXIS
,TYPE_XSLT_FUNCTION
,TYPE_XSLT_ELEMENT
,TYPE_XSLT_ATTRIBUTE
,TYPE_FILE_NAME
,TYPE_FOLDER
orTYPE_UNKNOWN
.
-
valueOf
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
Sets the value.- Parameters:
value
- The new value.
-
setType
public void setType(int type) Set the value type.- Parameters:
type
- The value type.
-