Package ro.sync.contentcompletion.xml
Class WhatPossibleValuesHasAttributeContext
java.lang.Object
ro.sync.contentcompletion.xml.Context
ro.sync.contentcompletion.xml.WhatContextInParent
ro.sync.contentcompletion.xml.WhatPossibleValuesHasAttributeContext
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from class ro.sync.contentcompletion.xml.WhatContextInParent
parentElement
Fields inherited from class ro.sync.contentcompletion.xml.Context
elementStack, idValuesList, infoProvider, nextSiblingElements, prefixNamespaceMapping, previousSiblingElements, xmlReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
getAncestorValues
(String name, String namespace, String attribute) Get the values of the specified (by name) attribute from the ancestors with the givenname
andnamespace
.Gets the name of the attribute, including the namespace prefix, if any.Gets the Value of the attribute, if any.Get the existing attribute value before the activation char.Get the already inserted value prefix.Get the grandparent's attributes.Get the qualified name of the grand parent element.Get the namespace of the grand parent element.void
setAttributeName
(String attributeName) Sets the attribute name, including the namespace prefix, if any.void
setAttributeValue
(String attributeValue) Sets the existing attribute value, if any.void
setCurrentValueBeforeActivationChar
(String currentValueBeforeActivationChar) Set the current attribute value before the activation charactervoid
setCurrentValuePrefix
(String currentValuePrefix) Set the the already inserted value prefix.toString()
Get a description of the current context.Methods inherited from class ro.sync.contentcompletion.xml.WhatContextInParent
getParentElement, getPreviousAttributeNames, getPreviousAttributes, getPreviousAttributesList, getRootAttributes, pushContextElement, setParentElement
Methods inherited from class ro.sync.contentcompletion.xml.Context
computeContextXPathExpression, equals, executeXPath, executeXPath, getDefaultAttributeValue, getElementStack, getIdValuesList, getNextSiblingElements, getPrefixNamespaceMapping, getPreviousSiblingElements, getProxyNamespaceMapping, getSystemID, setAdditionalContextInformationProvider, setElementStack, setIdValuesList, setNextSiblingElements, setPrefixNamespaceMapping, setPreviousSiblingElements, setXMLReader
-
Constructor Details
-
WhatPossibleValuesHasAttributeContext
public WhatPossibleValuesHasAttributeContext()
-
-
Method Details
-
getAttributeName
Gets the name of the attribute, including the namespace prefix, if any.- Returns:
- The attribute name.
-
setAttributeName
Sets the attribute name, including the namespace prefix, if any.- Parameters:
attributeName
- The attribute name.
-
getAttributeValue
Gets the Value of the attribute, if any.- Returns:
- The attribute value.
-
setAttributeValue
Sets the existing attribute value, if any.- Parameters:
attributeValue
- The attribute value.
-
toString
Get a description of the current context.- Overrides:
toString
in classro.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:
-
getGrandparentAttributes
Get the grandparent's attributes.- Returns:
- The grandparent attributes.
-
getGrandparentElement
Get the qualified name of the grand parent element.- Returns:
- The name of the attribute grandparent element.
- Throws:
EmptyStackException
- In case the stack is empty.
-
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:
EmptyStackException
- In case the stack is empty.
-
getAncestorValues
Get the values of the specified (by name) attribute from the ancestors with the givenname
andnamespace
.- 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
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
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
Get the existing attribute value before the activation char. For instance, if having starting the CC at the position "|"<xsl:if test="element/na|" />
Then the value returned is "element".- Returns:
- Returns the current attribute value before the activation char.
-
setCurrentValueBeforeActivationChar
Set the current attribute value before the activation character- Parameters:
currentValueBeforeActivationChar
-
-
clone
- Overrides:
clone
in classro.sync.contentcompletion.xml.WhatContextInParent
- See Also:
-
WhatContextInParent.clone()
-
getDefaultAttributeValue
- Returns:
- The default value of the attribute in the associated schema.
-