|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jet.BodyContentWriter
public class BodyContentWriter
Standard implementation of JET2Writer
| Constructor Summary | |
|---|---|
BodyContentWriter()
|
|
| Method Summary | |
|---|---|
void |
addEventListener(java.lang.String category,
IWriterListener listener)
Add a listener to the writer life cycle events. |
void |
addPosition(java.lang.String category,
org.eclipse.jface.text.Position position)
Convenience method wrapping getDocument().addPosition(String, Position). |
void |
addPositionCategory(java.lang.String category)
Convenience method wrapping getDocument().addPositionCategory(String). |
void |
contentCommitted(java.lang.Object committedObject)
Inform listeners that the content has been committed to some permanent store. |
void |
finalizeContent(java.lang.Object file)
Finalize the writers contents. |
org.eclipse.jface.text.IDocument |
getDocument()
Return the backing IDocument for this writer. |
int |
getLength()
Return the current length (in characters) of the output |
JET2Writer |
getParentWriter()
Return the parent of this writer, if it was created via JET2Writer.newNestedContentWriter(). |
org.eclipse.jface.text.Position[] |
getPositions(java.lang.String category)
Convenience method wrapping getDocument().getPositions(String). |
JET2Writer |
newNestedContentWriter()
Create a writer for handling nested content. |
void |
replace(int offset,
int length,
java.lang.String text)
Convenience method wrapping getDocument().replace(int,int,String). |
java.lang.String |
toString()
|
void |
write(boolean b)
Write the passed boolean by calling String.valueOf(boolean). |
void |
write(char c)
Write the passed character by calling String.valueOf(char). |
void |
write(char[] data)
Write the passed character array by calling String.valueOf(char[]). |
void |
write(double d)
Write the passed double value by calling String.valueOf(double). |
void |
write(float f)
Write the passed float value by calling String.valueOf(float). |
void |
write(int i)
Write the passed integer by calling String.valueOf(int). |
void |
write(JET2Writer bodyContent)
Write the contents of the passed writer to this writer. |
void |
write(long l)
Write the passed long value calling String.valueOf(long). |
void |
write(java.lang.Object obj)
Write the pass object by calling Object.toString(). |
void |
write(java.lang.String string)
Write the passed string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BodyContentWriter()
| Method Detail |
|---|
public final void write(java.lang.String string)
JET2Writer
write in interface JET2Writerstring - a string value.JET2Writer.write(java.lang.String)public final void write(JET2Writer bodyContent)
JET2Writer
write in interface JET2WriterbodyContent - a writerJET2Writer.write(org.eclipse.jet.JET2Writer)public final void write(int i)
JET2WriterString.valueOf(int).
write in interface JET2Writeri - an integer valueJET2Writer.write(int)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public final JET2Writer newNestedContentWriter()
JET2Writer
newNestedContentWriter in interface JET2Writerpublic final int getLength()
JET2Writer
getLength in interface JET2Writerpublic final org.eclipse.jface.text.IDocument getDocument()
JET2Writer
getDocument in interface JET2Writer
public final void addEventListener(java.lang.String category,
IWriterListener listener)
JET2WriterJET2Writer.newNestedContentWriter(), then the listener is added
to the root writer, rather than the listener itself.
addEventListener in interface JET2Writercategory - the listener categorylistener - a listener
public final void finalizeContent(java.lang.Object file)
throws JET2TagException
JET2WriterIWriterListener.finalizeContent(JET2Writer, Object) on all registered listeners.
Listeners are called in the
order in which the listeners were registered via JET2Writer.addEventListener(String, IWriterListener).
The type of file varies depending on the context in which the content
is finalized. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.
finalizeContent in interface JET2Writerfile - the file object to which the finalized contents will be written.
JET2TagException - if an error occursJET2Writer.addEventListener(String, IWriterListener)
public final void contentCommitted(java.lang.Object committedObject)
throws JET2TagException
JET2WriterIWriterListener.postCommitContent(JET2Writer, Object) on all registered listeners.
Listeners are called in the
order in which the listeners were registered via JET2Writer.addEventListener(String, IWriterListener).
The type of committedObject varies, depending on the context in which the content
is committed. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.
contentCommitted in interface JET2WritercommittedObject - the committed object.
JET2TagException - if event handle cannot terminate correctly.public final void addPositionCategory(java.lang.String category)
JET2Writer
addPositionCategory in interface JET2Writercategory - a Position CategoryIDocument.addPositionCategory(java.lang.String)
public final void addPosition(java.lang.String category,
org.eclipse.jface.text.Position position)
JET2WriterBadPositionCategoryException or
BadLocationException is wrapped in a
a runtime exception.
addPosition in interface JET2Writercategory - a position categoryposition - a positionIDocument.addPosition(java.lang.String, org.eclipse.jface.text.Position)public final org.eclipse.jface.text.Position[] getPositions(java.lang.String category)
JET2WriterBadPositionCategoryException
is wrapped in a runtime exception.
getPositions in interface JET2Writercategory - a position category
IDocument.getPositions(java.lang.String)
public final void replace(int offset,
int length,
java.lang.String text)
JET2WriterBadLocationException
is wrapped in a runtime exception.
replace in interface JET2Writeroffset - the offset of the text to replacelength - the length of the text to replacetext - the replacement textIDocument.replace(int, int, java.lang.String)public final JET2Writer getParentWriter()
JET2WriterJET2Writer.newNestedContentWriter().
getParentWriter in interface JET2Writernull.public final void write(boolean b)
JET2WriterString.valueOf(boolean).
write in interface JET2Writerb - a boolean valuepublic final void write(char c)
JET2WriterString.valueOf(char).
write in interface JET2Writerc - a char valuepublic final void write(char[] data)
JET2WriterString.valueOf(char[]).
write in interface JET2Writerdata - an array of characterspublic final void write(double d)
JET2WriterString.valueOf(double).
write in interface JET2Writerd - a double valuepublic final void write(float f)
JET2WriterString.valueOf(float).
write in interface JET2Writerf - a float valuepublic final void write(long l)
JET2WriterString.valueOf(long).
write in interface JET2Writerl - a long value.public final void write(java.lang.Object obj)
JET2WriterObject.toString().
write in interface JET2Writerobj - an object.
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||