Oxygen XML Editor 11.2 Author API

ro.sync.contentcompletion.xml
Class WhatPossibleValuesHasAttributeContext

java.lang.Object
  extended by ro.sync.contentcompletion.xml.Context
      extended by ro.sync.contentcompletion.xml.WhatContextInParent
          extended by ro.sync.contentcompletion.xml.WhatPossibleValuesHasAttributeContext
All Implemented Interfaces:
Cloneable

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, prefixNamespaceMapping, previousSiblingElements, xmlReader
 
Constructor Summary
WhatPossibleValuesHasAttributeContext()
           
 
Method Summary
 Object clone()
           
 List<String> getAncestorValues(String name, String namespace, String attribute)
          Get the values of the specified (by name) attribute from the ancestors with the given name and namespace.
 String getAttributeName()
          Gets the name of the attribute, including the namespace prefix, if any.
 String getCurrentValuePrefix()
          Get the already inserted value prefix.
 String getGrandparentElement()
          Get the qualified name of the grand parent element.
 String getGrandparentNamespace()
          Get the namespace of the grand parent element.
 void setAttributeName(String attributeName)
          Sets the attribute name, including the namespace prefix, if any.
 void setCurrentValuePrefix(String currentValuePrefix)
          Set the the already inserted value prefix.
 String 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
executeXPath, getElementStack, getPrefixNamespaceMapping, getPreviousSiblingElements, setElementStack, setPrefixNamespaceMapping, setPreviousSiblingElements, setXMLReader
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WhatPossibleValuesHasAttributeContext

public WhatPossibleValuesHasAttributeContext()
Method Detail

getAttributeName

public String getAttributeName()
Gets the name of the attribute, including the namespace prefix, if any.

Returns:
The attribute name.

setAttributeName

public void setAttributeName(String attributeName)
Sets the attribute name, including the namespace prefix, if any.

Parameters:
attributeName - The attribute name.

toString

public String toString()
Get a description of the current context.

Overrides:
toString in class Object
Returns:
A string containing information about the current context: attribute name, parent element qualified name, parent element type, element stack.

getGrandparentElement

public String 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

public 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:
EmptyStackException - In case the stack is empty.

getAncestorValues

public List<String> getAncestorValues(String name,
                                      String namespace,
                                      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 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(String currentValuePrefix)
Set the the already inserted value prefix.

Parameters:
currentValuePrefix - The text from the start position of the attribute value and the caret position.

clone

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

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.