Interface CMElementDeclaration
-
- All Known Implementing Classes:
CMDTDElementDeclaration,CMRelaxNGElementDeclaration,CMXSDElementDeclaration
public interface CMElementDeclarationContent model element which abstracts element declaration from a given grammar (XML Schema, DTD).
-
-
Field Summary
Fields Modifier and Type Field Description static Collection<CMElementDeclaration>ANY_ELEMENT_DECLARATIONS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CMAttributeDeclarationfindCMAttribute(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.CMElementDeclarationfindCMElement(String tag, String namespace)Returns the declared element which matches the given XML tag name / namespace and null otherwise.Collection<CMAttributeDeclaration>getAttributes()Returns the attributes of this declared element.StringgetDocumentation(ISharedSettingsRequest request)Returns formatted documentation of the declared element, according to settings defined inrequest.StringgetDocumentURI()Returns the owner document URI where the element is declared.Collection<CMElementDeclaration>getElements()Returns the children declared element of this declared element.Collection<String>getEnumerationValues()Return the enumeration values.StringgetLocalName()Returns the declared element local name.default StringgetName(String prefix)Returns the declared element name with the given prefix.StringgetNamespace()Returns the target namespace and null otherwise.Collection<CMElementDeclaration>getPossibleElements(DOMElement parentElement, int offset)Returns the possible declared elements at the given offset of the given parent element.StringgetPrefix(String namespaceURI)Returns the xmlns prefix from the given namespace URI and null otherwise.Collection<CMElementDeclaration>getRequiredElements()Returns a list of required/non-optional child elements of the current element.StringgetTextDocumentation(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.booleanisMixedContent()Returns true if the element can contains text and element both and false otherwise.booleanisNillable()Returns 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.booleanisStringType()Returns true if the element is a string type (ex : xs:string) and false otherwise.
-
-
-
Field Detail
-
ANY_ELEMENT_DECLARATIONS
static final Collection<CMElementDeclaration> ANY_ELEMENT_DECLARATIONS
-
-
Method Detail
-
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
String getPrefix(String namespaceURI)
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
default String getName(String prefix)
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
Collection<CMElementDeclaration> getPossibleElements(DOMElement parentElement, int offset)
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
CMElementDeclaration findCMElement(String tag, String namespace)
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
default CMAttributeDeclaration findCMAttribute(DOMAttr attr)
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
CMAttributeDeclaration findCMAttribute(String attributeName, String namespace)
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.
-
getDocumentation
String getDocumentation(ISharedSettingsRequest request)
Returns formatted documentation of the declared element, according to settings defined inrequest.- Parameters:
request- the request containing settings- Returns:
- formatted documentation of the declared element, according to
settings defined in
request.
-
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.
-
getTextDocumentation
String getTextDocumentation(String value, ISharedSettingsRequest request)
Returns the documentation for the given enumeration value and null otherwise.- Parameters:
value- the enumeration value.request- the shared settings.- Returns:
- the documentation for the given enumeration value and null otherwise.
-
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
boolean isOptional(String childElementName)
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.
-
-