Extension SDK 10.1.3.36.73

oracle.jdeveloper.jsp.utils
Class JSPTagUtils

java.lang.Object
  extended byoracle.jdeveloper.jsp.utils.JSPTagUtils

public final class JSPTagUtils
extends java.lang.Object

The JSPTagUtils class is a utility class to insert/remove tags and their associated taglib declarations into the CodeEditor.


Nested Class Summary
static class JSPTagUtils.JspLibraryComparator
           
 
Method Summary
static void addArchive(JspLibrary jspLib, Project prj)
          Deprecated. use #updateProjectWithTagLibrary(JspLibrary , JProject)
static void addArchive(JspLibrary jspLib, java.net.URL _url, Project prj)
          Deprecated. use #updateProjectWithTagLibrary(JspLibrary, JProject)
static void addTaglibDefinitionToActiveProject(java.lang.String uri, java.lang.String archiveLocation)
          Deprecated.  
static void addTagLibMap(Project prj, oracle.jdeveloper.xml.j2ee.war.WebAppNode webAppNode, java.lang.String taglibUri, java.lang.String taglibLocation)
          Inserts new explicit tag-lib entry in the web.xml file.
static void addTld(JspLibrary jspLib, Project prj)
          Deprecated. use updateProjectWithTagLibrary() method to add tag library to the project. It will do all needed actions.
static java.lang.String formatXMLString(java.lang.String xml)
          Returns a properly formatted XMLDocument string.
static JspLibrary getJspLibrary(java.lang.String libraryName)
          Returns the latest version of the system tag library with the given name.
static JspLibrary getJspLibrary(java.lang.String libraryName, Project project)
          If a tag library with given name is used in the project, returns that library.
static JspLibrary getJspLibraryByPrefix(java.lang.String prefix, Context context)
           
static JspLibrary getJspLibraryByURI(java.lang.String uri)
          Returns the latest version of the system tag library with the given URI.
static JspLibrary getJspLibraryByURI(java.lang.String uri, Project project)
          If a tag library with given URI is used in the project, returns that library.
static java.io.InputStream getLibraryInputStream(java.lang.String tldURL)
          Retrieve InputStream for Tag Library
static java.lang.String getTaglib(java.lang.String prefix)
          Deprecated.  
static java.net.URL getTaglibDescriptorArchiveURL(java.lang.String tldURL)
          Returns URL of the archive file containing TLD file.
static java.net.URL getTaglibDescriptorURL(java.lang.String tldURL)
          Returns a URL pointing to the TLD file given by the tldURL.
static java.util.Iterator getTagsInLibrary(JspLibrary jspLibrary)
          Returns a list of all Tag Names in a given JspLibrary
static java.net.URL getWebInfLibURL(Project project)
          Returns the current WEB-INF/lib directory of the project.
static java.net.URL getWebInfURL(Project project)
          Returns the current WEB-INF directory of the project.
static void insertAtPosition(java.lang.String str, int position)
          Deprecated.  
static void insertAtPosition(java.lang.String tag, int position, Node node)
          Deprecated.  
static void insertTag(java.lang.String tag)
          Deprecated.  
static void insertTagAndTaglib(java.lang.String tag, java.lang.String taglib)
          Deprecated.  
static void insertTaglib(JspLibrary jspLib)
          Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )
static void insertTaglib(java.lang.String taglib)
          Deprecated. HtmlLexerUtil removed, use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel ) Inserts a taglib declaration into the CodeEditor (Note: Inserts at the top position)
static void insertTaglib(java.lang.String taglib, Node node)
          Deprecated. HtmlLexerUtil removed, use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )
static void insertTaglib(java.lang.String uri, java.lang.String prefix)
          Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )
static void insertTaglib(java.lang.String uri, java.lang.String prefix, Node node)
          Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )
static void removeTagLibMap(oracle.jdeveloper.xml.j2ee.war.WebAppNode webAppNode, java.lang.String taglibUri)
          Removes explicit tag-lib entry from the web.xml file.
static boolean unregisterTagLibrary(Context context, java.lang.String libraryName)
          Deprecated.  
static void updateProjectWithTagLibraries(JspLibrary[] jspLibs, Project project)
           
static void updateProjectWithTagLibrary(JspLibrary jspLib, Project project)
          Updates project with the current Jsplibrary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWebInfURL

public static final java.net.URL getWebInfURL(Project project)
Returns the current WEB-INF directory of the project.

Parameters:
project - The current project
Returns:
url The WEB-INF url.

getWebInfLibURL

public static final java.net.URL getWebInfLibURL(Project project)
Returns the current WEB-INF/lib directory of the project.

Parameters:
project - The current project
Returns:
url The WEB-INF/lib url.

getJspLibrary

public static final JspLibrary getJspLibrary(java.lang.String libraryName)
Returns the latest version of the system tag library with the given name.

Parameters:
libraryName -
Returns:

getJspLibrary

public static final JspLibrary getJspLibrary(java.lang.String libraryName,
                                             Project project)
If a tag library with given name is used in the project, returns that library. Otherwis,e returns the latest version of the system tag library with the given name that can work within the given project.

Parameters:
libraryName -
project -
Returns:

getJspLibraryByURI

public static final JspLibrary getJspLibraryByURI(java.lang.String uri)
Returns the latest version of the system tag library with the given URI.

Parameters:
uri -
Returns:

getJspLibraryByURI

public static final JspLibrary getJspLibraryByURI(java.lang.String uri,
                                                  Project project)
If a tag library with given URI is used in the project, returns that library. Otherwise returns the latest version of the system tag library with the given URI that can work within the given project.

Parameters:
uri -
project -
Returns:

getJspLibraryByPrefix

public static final JspLibrary getJspLibraryByPrefix(java.lang.String prefix,
                                                     Context context)

getTagsInLibrary

public static java.util.Iterator getTagsInLibrary(JspLibrary jspLibrary)
Returns a list of all Tag Names in a given JspLibrary

Parameters:
jspLibrary - JspLibrary to search
Returns:
ArrayList List of all Tag Names (Strings)

getTaglibDescriptorURL

public static java.net.URL getTaglibDescriptorURL(java.lang.String tldURL)
Returns a URL pointing to the TLD file given by the tldURL. URL can be an entry inside an archive or a TLD file.


getLibraryInputStream

public static java.io.InputStream getLibraryInputStream(java.lang.String tldURL)
Retrieve InputStream for Tag Library


getTaglibDescriptorArchiveURL

public static java.net.URL getTaglibDescriptorArchiveURL(java.lang.String tldURL)
Returns URL of the archive file containing TLD file.

Returns:
null if tldURL is not valid entry inside an archive

updateProjectWithTagLibrary

public static final void updateProjectWithTagLibrary(JspLibrary jspLib,
                                                     Project project)
Updates project with the current Jsplibrary. This does not effect code generation. Adds an archive to the web-inf lib directory and adds archive to project. Updates web.xml if necessary. If library is not globally defined, adding it will be ignored.

Parameters:
jspLib - - the Jsplibary to add to project
project - - the project to add Jsplibrary to.

updateProjectWithTagLibraries

public static final void updateProjectWithTagLibraries(JspLibrary[] jspLibs,
                                                       Project project)

addTld

public static final void addTld(JspLibrary jspLib,
                                Project prj)
Deprecated. use updateProjectWithTagLibrary() method to add tag library to the project. It will do all needed actions.

Updates the project to handle the specified JSP Tag Library. This method will handle 3 different types of Tag Libraries.
1) Spec. 1.1 taglib where the file is named taglib.tld and exists under meta-inf in an archive.
2) Handle implicit taglibs as specified by spec. 1.2. This handles the uri specified in that taglib.
3) Handle explicit taglibs where the registered does not match the one found in the taglib itself.

Parameters:
jspLib - The JSP Tag Library to add to the project
prj - The project to update.

unregisterTagLibrary

public static boolean unregisterTagLibrary(Context context,
                                           java.lang.String libraryName)
Deprecated.  

Removes all reference of a tag library from the web deployment descriptor as well as from the additional classpath.


addArchive

public static void addArchive(JspLibrary jspLib,
                              Project prj)
Deprecated. use #updateProjectWithTagLibrary(JspLibrary , JProject)

Adds an archive to the Web-inf lib directory and adds archive to project.


addArchive

public static void addArchive(JspLibrary jspLib,
                              java.net.URL _url,
                              Project prj)
Deprecated. use #updateProjectWithTagLibrary(JspLibrary, JProject)

Adds archives to lib folder under the document root / WEB-INF folder. Also update project libraries, and web.xml.


addTaglibDefinitionToActiveProject

public static void addTaglibDefinitionToActiveProject(java.lang.String uri,
                                                      java.lang.String archiveLocation)
Deprecated.  

Add taglib definition to web descriptor file


addTagLibMap

public static void addTagLibMap(Project prj,
                                oracle.jdeveloper.xml.j2ee.war.WebAppNode webAppNode,
                                java.lang.String taglibUri,
                                java.lang.String taglibLocation)
Inserts new explicit tag-lib entry in the web.xml file.


removeTagLibMap

public static void removeTagLibMap(oracle.jdeveloper.xml.j2ee.war.WebAppNode webAppNode,
                                   java.lang.String taglibUri)
Removes explicit tag-lib entry from the web.xml file.


getTaglib

public static final java.lang.String getTaglib(java.lang.String prefix)
Deprecated.  

Returns string representing taglib tag to be inserted in JSP page for tag library, with given prefix.


insertTagAndTaglib

public static void insertTagAndTaglib(java.lang.String tag,
                                      java.lang.String taglib)
Deprecated.  

Inserts a Tag and Taglib declaration into the Active CodeEditor

Parameters:
tag - Tag to insert. (Note: Uses the caretposition )
taglib - Taglib to insert. (Note: Will insert at the top position)

insertTag

public static void insertTag(java.lang.String tag)
Deprecated.  

Inserts a tag into the CodeEditor or into the JSP Visual Editor based on the current selection.

Parameters:
tag - The tag to insert.

insertTaglib

public static final void insertTaglib(java.lang.String uri,
                                      java.lang.String prefix,
                                      Node node)
Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )


insertTaglib

public static final void insertTaglib(java.lang.String uri,
                                      java.lang.String prefix)
Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )


insertTaglib

public static final void insertTaglib(java.lang.String taglib,
                                      Node node)
Deprecated. HtmlLexerUtil removed, use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )


insertTaglib

public static final void insertTaglib(java.lang.String taglib)
Deprecated. HtmlLexerUtil removed, use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel ) Inserts a taglib declaration into the CodeEditor (Note: Inserts at the top position)

Parameters:
taglib - taglib to insert

insertTaglib

public static void insertTaglib(JspLibrary jspLib)
Deprecated. use WebDocumentUtil#addTagLibrary( JspLibrary, JProject, AbstractModel )

Inserts a taglib declaration into the CodeEditor( Note: Inserts at the top position )

Parameters:
jspLib - JspLibrary to build declaration from

insertAtPosition

public static void insertAtPosition(java.lang.String tag,
                                    int position,
                                    Node node)
Deprecated.  


insertAtPosition

public static void insertAtPosition(java.lang.String str,
                                    int position)
Deprecated.  

Inserts given text at specified position

Parameters:
str - String to insert
position - int position to insert text at

formatXMLString

public static final java.lang.String formatXMLString(java.lang.String xml)
Returns a properly formatted XMLDocument string.

Returns:
xml formatted string.

Extension SDK 10.1.3.36.73

 

Copyright © 1997, 2005, Oracle.All rights reserved.