org.eclipse.jet.taglib
Interface TagDefinition


public interface TagDefinition

Expose the definition of a tag, as declared in a 'org.eclipse.jet.tagLibraries' extension.

This interface is not intended to be implemented by clients.


Method Summary
 TagAttributeDefinition getAttributeDefinition(java.lang.String name)
          Return the definition of the named attribute
 java.util.List getAttributeDefinitions()
          Return a list of attribute definitions for this tag
 java.lang.String getDescription()
           
 CustomTagKind getKind()
          Return the tag kind (CustomTagKind).
 java.lang.String getName()
          Return the name of the tag as it is registered in the tag library
 TagLibrary getTagLibrary()
          Return the TagLibrary that contains this tag definition.
 boolean isContentAllowed()
          Test whether the tag is allowed to have content (even empty content).
 boolean isDeprecated()
          Test if the tag is declared to be deprecated.
 boolean isEmptyTagAllowed()
          Test whether the tag is allowed to be specified in the empty tag form: <tagName/>.
 CustomTag newTagElement()
          Create a new instance of the tag element
 boolean removeWhenContainingLineIsEmpty()
          Indicate whether the compiler should remove whitespace including the trailing new line from tags that occur on an otherwise empty line.
 boolean requiresNewWriter()
          Test whether the tag requires a new writer for its contents.
 

Method Detail

getName

public java.lang.String getName()
Return the name of the tag as it is registered in the tag library

Returns:
the tag's name

getDescription

public java.lang.String getDescription()

getKind

public CustomTagKind getKind()
Return the tag kind (CustomTagKind).

Returns:
the tag kind.

newTagElement

public CustomTag newTagElement()
                        throws CoreException
Create a new instance of the tag element

Returns:
the created element
Throws:
CoreException - if the element cannot be created

getAttributeDefinition

public TagAttributeDefinition getAttributeDefinition(java.lang.String name)
Return the definition of the named attribute

Parameters:
name - the attribute name
Returns:
the attribute definition, or null if the name is not an attribute of the named tag.

getAttributeDefinitions

public java.util.List getAttributeDefinitions()
Return a list of attribute definitions for this tag

Returns:
a List of TagAttributeDefinition objects. The empty list is returned if there are no attribute definitions for this tag definition.

isDeprecated

public boolean isDeprecated()
Test if the tag is declared to be deprecated.

Returns:
true if the tag is deprecated.

requiresNewWriter

public boolean requiresNewWriter()
Test whether the tag requires a new writer for its contents. The following tag declaration will have the value set to true:
  • functionTag
  • containerTag with processContents set to custom.
  • conditionalTag with processContents set to custom.
  • iteratingTag with processContents set to custom.
  • Returns:
    true if a new writer is required, false otherwise.

    isEmptyTagAllowed

    public boolean isEmptyTagAllowed()
    Test whether the tag is allowed to be specified in the empty tag form: <tagName/>. The following tag declarations will have the value set to true.
  • emptyTag
  • containerTag with allowAsEmpty set to true.
  • Returns:
    true if the tag may be expressed as a empty tag.

    isContentAllowed

    public boolean isContentAllowed()
    Test whether the tag is allowed to have content (even empty content). That is, this method tests whether a tag of the form:
    <tagName> ... </tagName>
    The following tag declarations will have the value set to true:
  • functionTag
  • containerTag
  • conditionalTag
  • iteratingTag
  • Returns:
    true if the tag may be expressed as a content tag.

    getTagLibrary

    public TagLibrary getTagLibrary()
    Return the TagLibrary that contains this tag definition.

    Returns:
    a TagLibrary instance.

    removeWhenContainingLineIsEmpty

    public boolean removeWhenContainingLineIsEmpty()
    Indicate whether the compiler should remove whitespace including the trailing new line from tags that occur on an otherwise empty line.

    Returns:
    true if such whitespace should be removed.

    Copyright 2006 IBM Corporation and others.
    All Rights Reserved.