java.lang.Object
org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax

@NoExtend @NoInstantiate public class DslElementSyntax extends Object
Provides a declaration of how a Component is represented in XML, containing all the required information for the XML element creation and parsing.
Since:
1.0
  • Constructor Details

    • DslElementSyntax

      public DslElementSyntax(String attributeName, String elementName, String prefix, String namespace, boolean isWrapped, boolean supportsAttributeDeclaration, boolean supportsChildDeclaration, boolean supportsTopLevelDeclaration, boolean requiresConfig, Map<org.mule.metadata.api.model.MetadataType,DslElementSyntax> genericsDsl, Map<String,DslElementSyntax> containedElements)
      Creates a new instance of DslElementSyntax
      Parameters:
      attributeName - the name of the attribute in the parent element that references this element
      elementName - the name of this xml element
      prefix - the prefix of this xml element
      isWrapped - false if the element implements the Component's type as an xml extension, or true if the element is a wrapper of a ref to the Component's type
      supportsAttributeDeclaration - true if this element supports to be declared as an attribute in the parent element
      supportsChildDeclaration - true if this element supports to be declared as a child element of its parent
      requiresConfig - whether the element requires a parameter pointing to the config
      genericsDsl - the DslElementSyntax of this element's type generics, if any is present, that complete the element description of container elements of generic types, like Collections or Maps for which the Dsl declaration is modified depending on the contained type.
  • Method Details

    • getElementName

      public String getElementName()
      Returns:
      the name of this xml element
    • getPrefix

      public String getPrefix()
      Returns:
      the prefix of this xml element
    • getNamespace

      public String getNamespace()
      Returns:
      the namespace of this xml element
    • isWrapped

      public boolean isWrapped()
      Returns:
      false if the element implements the Component's type as an xml extension, or true if the element is a wrapper of a ref to the Component's type
    • getAttributeName

      public String getAttributeName()
      Returns:
      the name of the attribute in the parent element that references this element
    • supportsAttributeDeclaration

      public boolean supportsAttributeDeclaration()
      Returns:
      true if this element supports to be declared as an attribute of its parent
    • supportsChildDeclaration

      public boolean supportsChildDeclaration()
      Returns:
      true if this element supports to be declared as a child element of its parent
    • supportsTopLevelDeclaration

      public boolean supportsTopLevelDeclaration()
      Returns:
      true if this element supports to be declared as a top level element
    • requiresConfig

      public boolean requiresConfig()
      Returns:
      true if this element requires having an attribute which points to a config
    • getGeneric

      public Optional<DslElementSyntax> getGeneric(org.mule.metadata.api.model.MetadataType type)
      Parameters:
      type - MetadataType of the generic for which its dsl is required
      Returns:
      the dsl for the given generic's type if one is present
    • getGenerics

      public Map<org.mule.metadata.api.model.MetadataType,DslElementSyntax> getGenerics()
    • getChild

      public Optional<DslElementSyntax> getChild(String name)
      Parameters:
      name - name of the child element for which its dsl is required
      Returns:
      the dsl of the child if one is present
    • getChilds

      public List<DslElementSyntax> getChilds()
      Returns:
      the dsl of the childs of this element
    • getAttribute

      public Optional<DslElementSyntax> getAttribute(String name)
      Parameters:
      name - name of the attribute element for which its dsl is required
      Returns:
      the dsl of the attribute if one is present
    • getAttributes

      public List<DslElementSyntax> getAttributes()
      Returns:
      the dsl of the attributes of this element
    • getContainedElement

      public Optional<DslElementSyntax> getContainedElement(String name)
      Parameters:
      name - name of the element for which its dsl is required
      Returns:
      the dsl of the element if one is present
    • getContainedElements

      public List<DslElementSyntax> getContainedElements()
      Returns:
      the dsl of all the contained elements of this element
    • getContainedElementsByName

      public Map<String,DslElementSyntax> getContainedElementsByName()
      Returns:
      the dsl of all the contained elements of this element
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object