Package ro.sync.contentcompletion.xml
Interface CIElement
- All Superinterfaces:
Comparable<CIElement>
,NodeDescription
- All Known Implementing Classes:
CIElementAdapter
@API(type=NOT_EXTENDABLE,
src=PRIVATE)
public interface CIElement
extends Comparable<CIElement>, NodeDescription
Interface for objects holding information about element proposals
used in the content completion process.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Elements with complex content, element only content type.static final int
Elements with complex content, empty content type.static final int
Elements with complex content, mixed content type.static final int
Type for elements with simple content. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGuessElement
(CIElement childElement) Add a child element to the list of element's children.Returns the list with the element attributes.Returns the list with the element attributes which have default values.int
Get the content type of the element.Get the list with the children elements of the current element.getQName()
Returns the qualified name of the element.Gets the type description for the element.boolean
true
if the element has a fixed value.boolean
boolean
boolean
isEmpty()
true
if the element is empty because it has empty content type or the element type isnillable
.boolean
void
setAnnotation
(String annotation) Sets the annotation for the element.void
setAttributes
(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 thexmlns
declaration must be added for the element.void
setHasFixedValueType
(boolean hasFixedValue) Set if the element has a fixed value.void
Set the name of the element.void
setNamespace
(String namespace) Set the namespace URI for the element.void
setNillable
(boolean nillable) Sets the flag representing the value of thenillable
attribute of element.void
Set the prefix associated with the element namespace.void
setTypeDescription
(String typeDescription) Sets the type description for the current elementMethods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface ro.sync.contentcompletion.xml.NodeDescription
getAnnotation, getAssertions, getFacetFractionDigitsValue, getFacetLengthValue, getFacetMaxExclusiveValue, getFacetMaxInclusiveValue, getFacetMaxLengthValue, getFacetMinExclusiveValue, getFacetMinInclusiveValue, getFacetMinLengthValue, getFacetPattern, getFacetTotalDigitsValue, getFacetWhitespaceValue, getModelDescription, getName, getOpenContentMode, getOpenContentWildcardDescription, getPossibleValues, setAssertions, setFacetFractionDigitsValue, setFacetLengthValue, setFacetMaxExclusiveValue, setFacetMaxInclusiveValue, setFacetMaxLengthValue, setFacetMinExclusiveValue, setFacetMinInclusiveValue, setFacetMinLengthValue, setFacetPattern, setFacetTotalDigitsValue, setFacetWhitespaceValue, setModelDescription, setOpenContentMode, setOpenContentWildcardDescription, setPossiblesValues
-
Field Details
-
CONTENT_TYPE_NOT_DETERMINED
static final int CONTENT_TYPE_NOT_DETERMINEDType for elements with simple content. The value is-1
- See Also:
-
CONTENT_TYPE_EMPTY
static final int CONTENT_TYPE_EMPTYElements with complex content, empty content type. The value is1
.- See Also:
-
CONTENT_TYPE_ELEMENT_ONLY
static final int CONTENT_TYPE_ELEMENT_ONLYElements with complex content, element only content type. The value is2
.- See Also:
-
CONTENT_TYPE_MIXED
static final int CONTENT_TYPE_MIXEDElements with complex content, mixed content type. The value is3
.- See Also:
-
-
Method Details
-
getGuessElements
Get the list with the children elements of the current element. When the currentCIElement
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 ifperson
is the currentCIElement
, and the list of children contains the elementsname
andaddress
, 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>
SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext)
method in order to return a customized list of children, thus modifying the original list proposed by theSchemaManager
.- Returns:
- A list of
CIElement
objects, ornull
if the element accepts no children.
-
addGuessElement
Add a child element to the list of element's children. When the currentCIElement
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 ifperson
is the currentCIElement
, and the list of children contains the elementsname
andaddress
, 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>
SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext)
method to add new children to theCIElements
proposed by the originalSchemaManager
.- Parameters:
childElement
- TheCIElement
element to be added as child.
-
getNamespace
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 thexmlns
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
.
-
setHasFixedValueType
void setHasFixedValueType(boolean hasFixedValue) Set if the element has a fixed value.- Parameters:
hasFixedValue
-true
if the element has a fixed value.
-
isEmpty
boolean isEmpty()true
if the element is empty because it has empty content type or the element type isnillable
.- Returns:
- true if empty content type or nillable content.
-
hasFixedValue
boolean hasFixedValue()true
if the element has a fixed value.- Returns:
- true if the element has a fixed value.
-
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 anxmlns
declaration.
-
setName
Set the name of the element.- Parameters:
name
- the name of the element.
-
setPrefix
Set the prefix associated with the element namespace.- Parameters:
prefix
- The namespace prefix to be set.
-
setNamespace
Set the namespace URI for the element.- Parameters:
namespace
- The namespace URI to be set.
-
getQName
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 arenull
.
-
getAttributes
List<CIAttribute> getAttributes()Returns the list with the element attributes.- Returns:
- The list with
CIAttribute
ornull
if the element has no attributes.
-
getAttributesWithDefaultValues
List<CIAttribute> getAttributesWithDefaultValues()Returns the list with the element attributes which have default values.- Returns:
- The list with
CIAttribute
which have default values ornull
if the element has no attributes.
-
setAttributes
Sets the list with the element attributes.- Parameters:
attributes
- The list ofCIAttribute
to be set.
-
hasPrefix
boolean hasPrefix()- Returns:
true
if a namespace prefix was previously set.
-
getPrefix
String getPrefix()- Returns:
- The namespace prefix or
null
if the element has no prefix set.
-
setAnnotation
Sets the annotation for the element.- Parameters:
annotation
- A text annotation for the element, ornull
.
-
getTypeDescription
String getTypeDescription()Gets the type description for the element.- Returns:
- A
String
description of the element type.
-
setTypeDescription
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 thenillable
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 isnillable
.
-
isNillable
boolean isNillable()- Returns:
true
if the content of the element isnillable
. Used only for XML Schema elements.
-