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 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 is 1.
        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 is 2.
        See Also:
        Constant Field Values
      • CONTENT_TYPE_MIXED

        static final int CONTENT_TYPE_MIXED
        Elements with complex content, mixed content type. The value is 3.
        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 current CIElement 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 if person is the current CIElement, and the list of children contains the elements name and address, 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>
         
        This method can be implemented by the CIElements returned by the SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext) method in order to return a customized list of children, thus modifying the original list proposed by the SchemaManager.
        Returns:
        A list of CIElement objects, or null if the element accepts no children.
      • addGuessElement

        void addGuessElement​(CIElement childElement)
        Add a child element to the list of element's children. When the current CIElement 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 if person is the current CIElement, and the list of children contains the elements name and address, 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>
         
        This method can be used in the SchemaManagerFilter.filterElements(List, WhatElementsCanGoHereContext) method to add new children to the CIElements proposed by the original SchemaManager.
        Parameters:
        childElement - The CIElement 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 the xmlns declaration must be added for the element.
        Parameters:
        declareXmlns - true if the namespace must be declared.
      • 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 is nillable.
        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.
      • isDeclareXmlns

        boolean isDeclareXmlns()
        Returns:
        true if the element has an xmlns 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 are null.
      • getAttributes

        java.util.List<CIAttribute> getAttributes()
        Returns the list with the element attributes.
        Returns:
        The list with CIAttribute or null 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 or null 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 of CIAttribute 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, or null.
      • 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 the nillable 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 is nillable.
      • isNillable

        boolean isNillable()
        Returns:
        true if the content of the element is nillable. Used only for XML Schema elements.