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 intElements with complex content, element only content type.static final intElements with complex content, empty content type.static final intElements with complex content, mixed content type.static final intType for elements with simple content. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGuessElement(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.intGet 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.booleantrueif the element has a fixed value.booleanbooleanbooleanisEmpty()trueif the element is empty because it has empty content type or the element type isnillable.booleanvoidsetAnnotation(String annotation) Sets the annotation for the element.voidsetAttributes(List<CIAttribute> attributes) Sets the list with the element attributes.voidsetContentType(int contentType) Sets the content type of the element.voidsetDeclareXmlns(boolean declareXmlns) Sets the value of the flag indicating if thexmlnsdeclaration must be added for the element.voidsetHasFixedValueType(boolean hasFixedValue) Set if the element has a fixed value.voidSet the name of the element.voidsetNamespace(String namespace) Set the namespace URI for the element.voidsetNillable(boolean nillable) Sets the flag representing the value of thenillableattribute of element.voidSet the prefix associated with the element namespace.voidsetTypeDescription(String typeDescription) Sets the type description for the current elementMethods inherited from interface java.lang.Comparable
compareToMethods 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 currentCIElementis 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 ifpersonis the currentCIElement, and the list of children contains the elementsnameandaddress, the result of choosing the person entry from the Content Completion window will be the insertion of the following sequence:
This method can be implemented by the CIElements returned by the<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
CIElementobjects, ornullif the element accepts no children.
-
addGuessElement
Add a child element to the list of element's children. When the currentCIElementis 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 ifpersonis the currentCIElement, and the list of children contains the elementsnameandaddress, the result of choosing the person entry from the Content Completion window will be the insertion of the following sequence:This method can be used in the<person> <name>...</name> <address>...</address> </person>SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext)method to add new children to theCIElementsproposed by the originalSchemaManager.- Parameters:
childElement- TheCIElementelement to be added as child.
-
getNamespace
String getNamespace()- Returns:
- The namespace URI of the element string or
nullif the element has no namespace.
-
setDeclareXmlns
void setDeclareXmlns(boolean declareXmlns) Sets the value of the flag indicating if thexmlnsdeclaration must be added for the element.- Parameters:
declareXmlns-trueif 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-trueif the element has a fixed value.
-
isEmpty
boolean isEmpty()trueif 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()trueif 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:
trueif the element has anxmlnsdeclaration.
-
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
nullif the local name and prefix arenull.
-
getAttributes
List<CIAttribute> getAttributes()Returns the list with the element attributes.- Returns:
- The list with
CIAttributeornullif the element has no attributes.
-
getAttributesWithDefaultValues
List<CIAttribute> getAttributesWithDefaultValues()Returns the list with the element attributes which have default values.- Returns:
- The list with
CIAttributewhich have default values ornullif the element has no attributes.
-
setAttributes
Sets the list with the element attributes.- Parameters:
attributes- The list ofCIAttributeto be set.
-
hasPrefix
boolean hasPrefix()- Returns:
trueif a namespace prefix was previously set.
-
getPrefix
String getPrefix()- Returns:
- The namespace prefix or
nullif 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
Stringdescription 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 thenillableattribute of element. Used only for elements defined in an XML Schema.- Parameters:
nillable-trueif the content of the element defined in the XML Schema isnillable.
-
isNillable
boolean isNillable()- Returns:
trueif the content of the element isnillable. Used only for XML Schema elements.
-