Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)?
Is there an unrestricted API similar to IModelManager.getModelForRead(IFile)? [message #203480] Fri, 02 November 2007 03:02 Go to previous message
Carlin Rogers is currently offline Carlin Rogers
Messages: 9
Registered: July 2009
Junior Member
Given an IFile for a JSP file, I'd like to know the best way to get an org.w3c.dom.Document.

I want the Document object so I can determine if a given taglib is present and then get the taglib namespace prefix and see if the Document contains certain tag.

Here are some more details...
I'm using the org.eclipse.wst.server.ui.moduleArtifactAdapters extension point to integrate with the "Run on Server" menu option. In my scenario, the object passed in to my ModuleArtifactAdapterDelegate implementation's getModuleArtifact() method will be a resource IFile.

I've saw some code in the newsgroup that uses the org.eclipse.wst.sse.core.internal.provisional.StructuredMode lManager to get the DOM model and then the get the DOM document. Something like this...

IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead(fil e);
IDOMModel domModel = (IDOMModel)model;
Document doc = domModel.getDocument();

....but I noticed the following warning in my dev env:

"Discouraged access: The method getModelForRead(IFile) from the type IModelManager is not accessible due to restriction on required library ...org.eclipse.wst.sse.core_1.1.101.v200611210021.jar"

Should I go ahead and use this or is there a public API I can use for reading in the IFile to get the DOM document and check for certain JSP tags?

Thanks,
Carlin
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:Can not profile tomat
Next Topic:Re: Mylyn 2.1 is now available
Goto Forum:
  


Current Time: Mon May 20 13:45:06 EDT 2013

Powered by FUDForum. Page generated in 0.02048 seconds