java.lang.Objectcom.ibm.jdg2e.resources.extensions.builder.ReadmeVisitor
Processes an IResourceDelta to find .readme files and create
stub .html files. Designed to be invoked as part of builder.
Source includes many System.out.println() trace entries that
have been commented out. If you want to visualize the flow of build
processing, uncomment these statements before starting a test cycle.
IResourceDelta,
IResourceDeltaVisitor| Constructor Summary | |
ReadmeVisitor()
|
|
| Method Summary | |
java.io.InputStream |
getReadmeContent(org.eclipse.core.resources.IFile readmeFile)
Wraps the InputStream available for the IFile
resource with some HTML content. |
void |
processReadme(org.eclipse.core.resources.IResource resource,
org.eclipse.core.resources.IContainer container)
Implements processing for a given .readme resource. |
boolean |
visit(org.eclipse.core.resources.IResourceDelta delta)
Required implementation of the visit method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ReadmeVisitor()
| Method Detail |
public java.io.InputStream getReadmeContent(org.eclipse.core.resources.IFile readmeFile)
InputStream available for the IFile
resource with some HTML content. Uses a simple approach, where a
ByteArrayInputStream is used to convert a
StringBuffer to a type of InputStream that
can be joined with another using SequenceInputStream.
readmeFile -
public void processReadme(org.eclipse.core.resources.IResource resource,
org.eclipse.core.resources.IContainer container)
.readme resource. This includes
creation of a matching .html file stub with limited hard coded content.
The .html file creation is forced. This means the create will succeed
even if a .html file with the same name exists on the file system but not
in the workspace. Any problem markers associated with an existing .html file
are removed.
resource - container -
public boolean visit(org.eclipse.core.resources.IResourceDelta delta)
throws org.eclipse.core.runtime.CoreException
IResourceDelta is processed by providing it a visitor
using the accept() method and using this method in the
visitor to process any events of interest.
Processing continues as long as this method returns true or when the end
of the IResourceDelta has been reached.
Files that have been IResourceDelta.ADDED or IResourceDelta.CHANGED
processed to create .html files if they are .readme files.
When a .readme is IResourceDelta.REMOVED, a problem marker is added
to identify the orphaned .html file. A marker quick fix is available to the
user to resolve this problem.
visit in interface org.eclipse.core.resources.IResourceDeltaVisitororg.eclipse.core.runtime.CoreExceptionIResourceDeltaVisitor.visit(org.eclipse.core.resources.IResourceDelta)