|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jet.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,
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. |
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 BodyContentWriter.newNestedContentWriter() . |
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 JET2Writer
string
- a string value.JET2Writer.write(java.lang.String)
public final void write(JET2Writer bodyContent)
JET2Writer
write
in interface JET2Writer
bodyContent
- a writerJET2Writer.write(org.eclipse.jet.JET2Writer)
public final void write(int i)
JET2Writer
String.valueOf(int)
.
write
in interface JET2Writer
i
- an integer valueJET2Writer.write(int)
public java.lang.String toString()
Object.toString()
public final JET2Writer newNestedContentWriter()
JET2Writer
newNestedContentWriter
in interface JET2Writer
public final int getLength()
JET2Writer
getLength
in interface JET2Writer
public final IDocument getDocument()
JET2Writer
getDocument
in interface JET2Writer
public final void addEventListener(java.lang.String category, IWriterListener listener)
JET2Writer
JET2Writer.newNestedContentWriter()
, then the listener is added
to the root writer, rather than the listener itself.
addEventListener
in interface JET2Writer
category
- the listener categorylistener
- a listenerpublic final void finalizeContent(java.lang.Object file) throws JET2TagException
JET2Writer
IWriterListener.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 JET2Writer
file
- 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
JET2Writer
IWriterListener.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 JET2Writer
committedObject
- the committed object.
JET2TagException
- if event handle cannot terminate correctly.public final void addPositionCategory(java.lang.String category)
JET2Writer
addPositionCategory
in interface JET2Writer
category
- a Position CategoryIDocument.addPositionCategory(java.lang.String)
public final void addPosition(java.lang.String category, Position position)
JET2Writer
BadPositionCategoryException
or
BadLocationException
is wrapped in a
a runtime exception.
addPosition
in interface JET2Writer
category
- a position categoryposition
- a positionIDocument.addPosition(java.lang.String, org.eclipse.jface.text.Position)
public final Position[] getPositions(java.lang.String category)
JET2Writer
BadPositionCategoryException
is wrapped in a runtime exception.
getPositions
in interface JET2Writer
category
- a position category
IDocument.getPositions(java.lang.String)
public final void replace(int offset, int length, java.lang.String text)
JET2Writer
BadLocationException
is wrapped in a runtime exception.
replace
in interface JET2Writer
offset
- 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()
JET2Writer
JET2Writer.newNestedContentWriter()
.
getParentWriter
in interface JET2Writer
null
.public final void write(boolean b)
JET2Writer
String.valueOf(boolean)
.
write
in interface JET2Writer
b
- a boolean valuepublic final void write(char c)
JET2Writer
String.valueOf(char)
.
write
in interface JET2Writer
c
- a char valuepublic final void write(char[] data)
JET2Writer
String.valueOf(char[])
.
write
in interface JET2Writer
data
- an array of characterspublic final void write(double d)
JET2Writer
String.valueOf(double)
.
write
in interface JET2Writer
d
- a double valuepublic final void write(float f)
JET2Writer
String.valueOf(float)
.
write
in interface JET2Writer
f
- a float valuepublic final void write(long l)
JET2Writer
String.valueOf(long)
.
write
in interface JET2Writer
l
- a long value.public final void write(java.lang.Object obj)
JET2Writer
Object.toString()
.
write
in interface JET2Writer
obj
- 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 |