org.eclipse.jet.core.parser.ast
Class TagLibraryUsageManager
java.lang.Object
org.eclipse.jet.core.parser.ast.TagLibraryUsageManager
-
public class TagLibraryUsageManager
- extends java.lang.Object
A class to manage usage of tag libraries in a JET2 template.
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
TagLibraryUsageManager
public TagLibraryUsageManager(java.util.Map predefinedLibraryMap,
ITagLibraryResolver tagLibraryResolver)
-
Parameters:
-
predefinedLibraryMap
- a map of predefined prefixes and their tag libary ids.
canDefinePrefix
public boolean canDefinePrefix(java.lang.String prefix,
java.lang.String id)
- Test whether a prefix can be created.
Conditions where this can succeed:
- prefix is not defined in either the predefined library map or the
library map.
-
-
Parameters:
-
prefix
- a prefix -
id
- the tag libary id.
-
Returns:
-
true
if the prefix can be created.
isLibraryDefined
public boolean isLibraryDefined(java.lang.String libaryId)
-
getLibraryIdFromPrefix
public java.lang.String getLibraryIdFromPrefix(java.lang.String prefix)
-
add
public void add(java.lang.String prefix,
java.lang.String libraryId)
- Defined a prefix for a tag library id. If a prefix for the tag library id
is already defined in the predefined librarys map, then that prefix is
removed.
-
-
Parameters:
-
prefix
- a prefix -
libraryId
- a library id
getTagDefinition
public
TagDefinition getTagDefinition(java.lang.String tagName)
- Return the TagDefinition of the selected tag.
-
-
Parameters:
-
tagName
- the QName of the tag
-
Returns:
- the TagDefinition
isKnownTag
public boolean isKnownTag(java.lang.String tagName)
- Test whether the tag name passed is know to this manager
-
-
Returns:
-
true
if the tag matches one of the libraries,
false
otherwise.
isKnownInvalidTagName
public boolean isKnownInvalidTagName(java.lang.String tagName)
- Test whether the tag name passed is known to be an invalid name by the
manager. The tag name is known to be invalid if it has a known prefix,
but an unknown unqualified tag name.
-
-
Returns:
-
true
if the tag matches one of the libraries,
false
otherwise.
getTagLibraryReferences
public
TagLibraryReference[] getTagLibraryReferences()
-
getKnownTagNames
public java.lang.String[] getKnownTagNames()
-