|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JET2Writer
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,
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 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). |
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 |
---|
void write(java.lang.String string)
string
- a string value.void write(JET2Writer bodyContent)
bodyContent
- a writervoid write(boolean b)
String.valueOf(boolean)
.
b
- a boolean valuevoid write(char c)
String.valueOf(char)
.
c
- a char valuevoid write(char[] data)
String.valueOf(char[])
.
data
- an array of charactersvoid write(double d)
String.valueOf(double)
.
d
- a double valuevoid write(float f)
String.valueOf(float)
.
f
- a float valuevoid write(int i)
String.valueOf(int)
.
i
- an integer valuevoid write(long l)
String.valueOf(long)
.
l
- a long value.void write(java.lang.Object obj)
Object.toString()
.
obj
- an object.JET2Writer newNestedContentWriter()
JET2Writer getParentWriter()
newNestedContentWriter()
.
null
.int getLength()
org.eclipse.jface.text.IDocument getDocument()
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 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 occursaddEventListener(String, IWriterListener)
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 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.void addEventListener(java.lang.String category, IWriterListener listener)
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
.void addPositionCategory(java.lang.String category)
category
- a Position Category
java.lang.IllegalArgumentException
- wrapping a BadPositionCategoryException
IDocument.addPositionCategory(java.lang.String)
void addPosition(java.lang.String category, org.eclipse.jface.text.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)
org.eclipse.jface.text.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)
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 |