|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Define a JET2 output writer
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 JET2Writer.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). |
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. |
Method Detail |
public void write(java.lang.String string)
string
- a string value.public void write(JET2Writer bodyContent)
bodyContent
- a writerpublic void write(boolean b)
String.valueOf(boolean)
.
b
- a boolean valuepublic void write(char c)
String.valueOf(char)
.
c
- a char valuepublic void write(char[] data)
String.valueOf(char[])
.
data
- an array of characterspublic void write(double d)
String.valueOf(double)
.
d
- a double valuepublic void write(float f)
String.valueOf(float)
.
f
- a float valuepublic void write(int i)
String.valueOf(int)
.
i
- an integer valuepublic void write(long l)
String.valueOf(long)
.
l
- a long value.public void write(java.lang.Object obj)
Object.toString()
.
obj
- an object.public JET2Writer newNestedContentWriter()
public JET2Writer getParentWriter()
JET2Writer.newNestedContentWriter()
.
null
.public int getLength()
public IDocument getDocument()
public void finalizeContent(java.lang.Object file) throws JET2TagException
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.
file
- the file object to which the finalized contents will be written.
JET2TagException
- if an error occursJET2Writer.addEventListener(String, IWriterListener)
public void contentCommitted(java.lang.Object committedObject) throws JET2TagException
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.
committedObject
- the committed object.
JET2TagException
- if event handle cannot terminate correctly.public void addEventListener(java.lang.String category, IWriterListener listener)
JET2Writer.newNestedContentWriter()
, then the listener is added
to the root writer, rather than the listener itself.
category
- the listener categorylistener
- a listener
java.lang.NullPointerException
- if listener is null
.public void addPositionCategory(java.lang.String category)
category
- a Position Category
java.lang.IllegalArgumentException
- wrapping a BadPositionCategoryException
IDocument.addPositionCategory(java.lang.String)
public void addPosition(java.lang.String category, Position position)
BadPositionCategoryException
or
BadLocationException
is wrapped in a
a runtime exception.
category
- a position categoryposition
- a position
WriterPositionException
- wrapping a BadPositionCategoryException
or BadLocationException
IDocument.addPosition(java.lang.String, org.eclipse.jface.text.Position)
public Position[] getPositions(java.lang.String category)
BadPositionCategoryException
is wrapped in a runtime exception.
category
- a position category
WriterPositionException
- wrapping a BadPositionCategoryException
IDocument.getPositions(java.lang.String)
public void replace(int offset, int length, java.lang.String text)
BadLocationException
is wrapped in a runtime exception.
offset
- the offset of the text to replacelength
- the length of the text to replacetext
- the replacement text
WriterPositionException
- wrapping a BadLocationException
IDocument.replace(int, int, java.lang.String)
|
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 |