Interface CMElementDeclaration
- All Known Implementing Classes:
CMDTDElementDeclaration,CMRelaxNGElementDeclaration,CMXSDElementDeclaration
public interface CMElementDeclaration
Content model element which abstracts element declaration from a given
grammar (XML Schema, DTD).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfindCMAttribute(String attributeName, String namespace) Returns the declared attribute which match the given name and null otherwise.default CMAttributeDeclarationfindCMAttribute(DOMAttr attr) Returns the declared attribute which match the given name and null otherwise.findCMElement(String tag, String namespace) Returns the declared element which matches the given XML tag name / namespace and null otherwise.Returns the attributes of this declared element.getDocumentation(ISharedSettingsRequest request) Returns formatted documentation of the declared element, according to settings defined inrequest.Returns the owner document URI where the element is declared.Returns the children declared element of this declared element.Return the enumeration values.Returns the declared element local name.default StringReturns the declared element name with the given prefix.Returns the target namespace and null otherwise.getPossibleElements(DOMElement parentElement, int offset) Returns the possible declared elements at the given offset of the given parent element.Returns the xmlns prefix from the given namespace URI and null otherwise.Returns a list of required/non-optional child elements of the current element.getTextDocumentation(String value, ISharedSettingsRequest request) Returns the documentation for the given enumeration value and null otherwise.booleanisEmpty()Returns true if the element cannot contains element children or text content and false otherwise.booleanReturns true if the element can contains text and element both and false otherwise.booleanReturns true if the element can have an explicit null value assigned to it.booleanisOptional(String childElementName) Returns true if the child element name is optional and false otherwise.booleanReturns true if the element is a string type (ex : xs:string) and false otherwise.
-
Field Details
-
ANY_ELEMENT_DECLARATIONS
-
-
Method Details
-
getLocalName
String getLocalName()Returns the declared element local name.- Returns:
- the declared element local name.
-
getNamespace
String getNamespace()Returns the target namespace and null otherwise.- Returns:
- the target namespace and null otherwise.
-
getPrefix
Returns the xmlns prefix from the given namespace URI and null otherwise.- Parameters:
namespaceURI- the namespace- Returns:
- the xmlns prefix from the given namespace URI and null otherwise.
-
getName
Returns the declared element name with the given prefix.- Returns:
- the declared element name with the given prefix.
-
getAttributes
Collection<CMAttributeDeclaration> getAttributes()Returns the attributes of this declared element.- Returns:
- the attributes element of this declared element.
-
getElements
Collection<CMElementDeclaration> getElements()Returns the children declared element of this declared element.- Returns:
- the children declared element of this declared element.
-
getPossibleElements
Returns the possible declared elements at the given offset of the given parent element.- Parameters:
parentElement- the parent elementoffset- the offset- Returns:
- the possible declared elements at the given offset of the given parent element.
-
findCMElement
Returns the declared element which matches the given XML tag name / namespace and null otherwise.- Parameters:
tag-namespace-- Returns:
- the declared element which matches the given XML tag name / namespace and null otherwise.
-
findCMAttribute
Returns the declared attribute which match the given name and null otherwise.- Parameters:
attribute- the DOM attribute- Returns:
- the declared attribute which match the given name and null otherwise.
-
findCMAttribute
Returns the declared attribute which match the given name and null otherwise.- Parameters:
attributeName- the attribute name.namespace- the attribute namespace and null otherwise.- Returns:
- the declared attribute which match the given name and null otherwise.
-
isEmpty
boolean isEmpty()Returns true if the element cannot contains element children or text content and false otherwise.- Returns:
- true if the element cannot contains element children or text content and false otherwise.
-
isNillable
boolean isNillable()Returns true if the element can have an explicit null value assigned to it.- Returns:
- true if the element can have an explicit null value assigned to it.
-
getEnumerationValues
Collection<String> getEnumerationValues()Return the enumeration values.- Returns:
- the enumeration values.
-
getDocumentURI
String getDocumentURI()Returns the owner document URI where the element is declared.- Returns:
- the owner document URI where the element is declared.
-
isStringType
boolean isStringType()Returns true if the element is a string type (ex : xs:string) and false otherwise.- Returns:
- true if the element is a string type (ex : xs:string) and false otherwise.
-
isMixedContent
boolean isMixedContent()Returns true if the element can contains text and element both and false otherwise.- Returns:
- true if the element can contains text and element both and false otherwise.
-
isOptional
Returns true if the child element name is optional and false otherwise.- Returns:
- true if the child element name is optional and false otherwise.
-
getRequiredElements
Collection<CMElementDeclaration> getRequiredElements()Returns a list of required/non-optional child elements of the current element.- Returns:
- a list of required/non-optional child elements of the current element.
-