Package ro.sync.contentcompletion.xml
Interface CIElement
-
- All Superinterfaces:
java.lang.Comparable<CIElement>
,NodeDescription
- All Known Implementing Classes:
CIElementAdapter
@API(type=NOT_EXTENDABLE, src=PRIVATE) 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
Fields Modifier and Type Field Description 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.java.util.List<CIAttribute>
getAttributesWithDefaultValues()
Returns the list with the element attributes which have default values.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
hasFixedValue()
true
if the element has a fixed value.boolean
hasPrefix()
boolean
isDeclareXmlns()
boolean
isEmpty()
true
if the element is empty because it has empty content type or the element type isnillable
.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 thexmlns
declaration must be added for the element.void
setHasFixedValueType(boolean hasFixedValue)
Set if the element has a fixed value.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 thenillable
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 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 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 is1
.- 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 is2
.- See Also:
- Constant Field Values
-
CONTENT_TYPE_MIXED
static final int CONTENT_TYPE_MIXED
Elements with complex content, mixed content type. The value is3
.- 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 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
void addGuessElement(CIElement childElement)
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
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 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
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 arenull
.
-
getAttributes
java.util.List<CIAttribute> getAttributes()
Returns the list with the element attributes.- Returns:
- The list with
CIAttribute
ornull
if the element has no attributes.
-
getAttributesWithDefaultValues
java.util.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
void setAttributes(java.util.List<CIAttribute> attributes)
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
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, ornull
.
-
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 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.
-
-