Oxygen XML Editor 12.2 Author API

ro.sync.contentcompletion.xml
Interface CIElement

All Superinterfaces:
java.lang.Comparable<CIElement>, NodeDescription
All Known Implementing Classes:
CIElementAdapter

public interface CIElement
extends java.lang.Comparable<CIElement>, NodeDescription

Interface for objects holding information about element proposals used in the content completion process.


Field Summary
static int CONTENT_TYPE_ELEMENT_ONLY
          Elements with complex content, element only content type.
static int CONTENT_TYPE_EMPTY
          Elements with complex content, empty content type.
static int CONTENT_TYPE_MIXED
          Elements with complex content, mixed content type.
static int CONTENT_TYPE_NOT_DETERMINED
          Type for elements with simple content.
 
Method Summary
 void addGuessElement(CIElement childElement)
          Add a child element to the list of element's children.
 java.util.List<CIAttribute> getAttributes()
          Returns the list with the element attributes.
 int getContentType()
          Get the content type of the element.
 java.util.List<CIElement> getGuessElements()
          Get the list with the children elements of the current element.
 java.lang.String getNamespace()
           
 java.lang.String getPrefix()
           
 java.lang.String getQName()
          Returns the qualified name of the element.
 java.lang.String getTypeDescription()
          Gets the type description for the element.
 boolean hasPrefix()
           
 boolean isDeclareXmlns()
           
 boolean isEmpty()
          true if the element is empty because it has empty content type or the element type is nillable.
 boolean isNillable()
           
 void setAnnotation(java.lang.String annotation)
          Sets the annotation for the element.
 void setAttributes(java.util.List<CIAttribute> attributes)
          Sets the list with the element attributes.
 void setContentType(int contentType)
          Sets the content type of the element.
 void setDeclareXmlns(boolean declareXmlns)
          Sets the value of the flag indicating if the xmlns declaration must be added for the element.
 void setName(java.lang.String name)
          Set the name of the element.
 void setNamespace(java.lang.String namespace)
          Set the namespace URI for the element.
 void setNillable(boolean nillable)
          Sets the flag representing the value of the nillable attribute of element.
 void setPrefix(java.lang.String prefix)
          Set the prefix associated with the element namespace.
 void setTypeDescription(java.lang.String typeDescription)
          Sets the type description for the current element
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface ro.sync.contentcompletion.xml.NodeDescription
getAnnotation, getFacetFractionDigitsValue, getFacetLengthValue, getFacetMaxExclusiveValue, getFacetMaxInclusiveValue, getFacetMaxLengthValue, getFacetMinExclusiveValue, getFacetMinInclusiveValue, getFacetMinLengthValue, getFacetPattern, getFacetTotalDigitsValue, getFacetWhitespaceValue, getModelDescription, getName, getPossibleValues, setFacetFractionDigitsValue, setFacetLengthValue, setFacetMaxExclusiveValue, setFacetMaxInclusiveValue, setFacetMaxLengthValue, setFacetMinExclusiveValue, setFacetMinInclusiveValue, setFacetMinLengthValue, setFacetPattern, setFacetTotalDigitsValue, setFacetWhitespaceValue, setModelDescription, setPossiblesValues
 

Field Detail

CONTENT_TYPE_NOT_DETERMINED

static final int CONTENT_TYPE_NOT_DETERMINED
Type for elements with simple content. The value is -1

See Also:
Constant Field Values

CONTENT_TYPE_EMPTY

static final int CONTENT_TYPE_EMPTY
Elements with complex content, empty content type. The value is 1.

See Also:
Constant Field Values

CONTENT_TYPE_ELEMENT_ONLY

static final int CONTENT_TYPE_ELEMENT_ONLY
Elements with complex content, element only content type. The value is 2.

See Also:
Constant Field Values

CONTENT_TYPE_MIXED

static final int CONTENT_TYPE_MIXED
Elements with complex content, mixed content type. The value is 3.

See Also:
Constant Field Values
Method Detail

getGuessElements

java.util.List<CIElement> getGuessElements()
Get the list with the children elements of the current element. When the current CIElement is chosen from the list of proposed elements (e.g. the list of proposals from the Content Completion window), the children elements are also inserted in the document.
For example if person is the current CIElement, and the list of children contains the elements name and address, the result of choosing the person entry from the Content Completion window will be the insertion of the following sequence:
 <person>
     <name>...</name>
     <address>...</address>
 </person>
 
This method can be implemented by the CIElements returned by the SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext) method in order to return a customized list of children, thus modifying the original list proposed by the SchemaManager.

Returns:
A list of CIElement objects, or null if the element accepts no children.

addGuessElement

void addGuessElement(CIElement childElement)
Add a child element to the list of element's children. When the current CIElement is chosen from the list of proposed elements (e.g. the list of proposals from the Content Completion window), the children elements are also inserted.
For example if person is the current CIElement, and the list of children contains the elements name and address, the result of choosing the person entry from the Content Completion window will be the insertion of the following sequence:
 <person>
     <name>...</name>
     <address>...</address>
 </person>
 
This method can be used in the SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext) method to add new children to the CIElements proposed by the original SchemaManager.

Parameters:
childElement - The CIElement element to be added as child.

getNamespace

java.lang.String getNamespace()
Returns:
The namespace URI of the element string or null if the element has no namespace.

setDeclareXmlns

void setDeclareXmlns(boolean declareXmlns)
Sets the value of the flag indicating if the xmlns declaration must be added for the element.

Parameters:
declareXmlns - true if the namespace must be declared.

setContentType

void setContentType(int contentType)
Sets the content type of the element.

Parameters:
contentType - The content type of the element. It can be one of the constants: CONTENT_TYPE_ELEMENT_ONLY, CONTENT_TYPE_EMPTY, CONTENT_TYPE_MIXED, CONTENT_TYPE_NOT_DETERMINED.

isEmpty

boolean isEmpty()
true if the element is empty because it has empty content type or the element type is nillable.

Returns:
true if empty content type or nillable content.

getContentType

int getContentType()
Get the content type of the element.

Returns:
The content type of the element. Can be one of the constants: CONTENT_TYPE_ELEMENT_ONLY, CONTENT_TYPE_EMPTY, CONTENT_TYPE_MIXED, CONTENT_TYPE_NOT_DETERMINED.

isDeclareXmlns

boolean isDeclareXmlns()
Returns:
true if the element has an xmlns declaration.

setName

void setName(java.lang.String name)
Set the name of the element.

Parameters:
name - the name of the element.

setPrefix

void setPrefix(java.lang.String prefix)
Set the prefix associated with the element namespace.

Parameters:
prefix - The namespace prefix to be set.

setNamespace

void setNamespace(java.lang.String namespace)
Set the namespace URI for the element.

Parameters:
namespace - The namespace URI to be set.

getQName

java.lang.String getQName()
Returns the qualified name of the element. It is obtained from the namespace prefix and the local name.

Returns:
The qualified name of the element or null if the local name and prefix are null.

getAttributes

java.util.List<CIAttribute> getAttributes()
Returns the list with the element attributes.

Returns:
The list with CIAttribute or null if the element has no attributes.

setAttributes

void setAttributes(java.util.List<CIAttribute> attributes)
Sets the list with the element attributes.

Parameters:
attributes - The list of CIAttribute to be set.

hasPrefix

boolean hasPrefix()
Returns:
true if a namespace prefix was previously set.

getPrefix

java.lang.String getPrefix()
Returns:
The namespace prefix or null if the element has no prefix set.

setAnnotation

void setAnnotation(java.lang.String annotation)
Sets the annotation for the element.

Parameters:
annotation - A text annotation for the element, or null.

getTypeDescription

java.lang.String getTypeDescription()
Gets the type description for the element.

Returns:
A String description of the element type.

setTypeDescription

void setTypeDescription(java.lang.String typeDescription)
Sets the type description for the current element

Parameters:
typeDescription - The String representing the type description.

setNillable

void setNillable(boolean nillable)
Sets the flag representing the value of the nillable attribute of element. Used only for elements defined in an XML Schema.

Parameters:
nillable - true if the content of the element defined in the XML Schema is nillable.

isNillable

boolean isNillable()
Returns:
true if the content of the element is nillable. Used only for XML Schema elements.

Oxygen XML Editor 12.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.