|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.unikiel.ipn.htmlform.Entry
An Entry.
Example:
You have a html-file containing
<html> <head> <title> Protocol </title> </head> <body> <!-- next log entry here --> </body> </html>
Entry
Object contains all information that is needed to
place
the new text in the correct position, including the text itself.
The whole project file is mostly about how to create the Entry Objects.
See project file documentation.
Constructor Summary | |
(package private) |
Entry(java.lang.String file)
Creates a new Entry. |
(package private) |
Entry(java.lang.String prefix,
java.lang.String content,
java.lang.String postfix,
java.lang.String file,
java.lang.String mark,
java.lang.String alignment,
java.lang.String append,
java.lang.String isRegex,
java.lang.String label)
Creates a new Entry. |
Method Summary | |
(package private) void |
accept(TextVisitor v)
Calls v.visit(this) on the argument.
|
(package private) void |
changeContent(java.lang.String s)
Replaces the content of this Entry. |
(package private) java.lang.String |
getAppend()
|
(package private) java.lang.String |
getContent()
|
(package private) javax.swing.text.Document |
getDocument()
Returns the content of this Entry as a javax.swing.text.Document. |
(package private) java.io.File |
getFile()
|
(package private) java.lang.String |
getLabel()
|
(package private) int |
getLeftAlignment()
|
(package private) java.lang.String |
getMark()
|
(package private) java.lang.String |
getPostfix()
|
(package private) java.lang.String |
getPrefix()
|
(package private) int |
getRightAlignment()
|
(package private) boolean |
isRegex()
|
(package private) void |
setContent(java.lang.String s)
Replaces the content of this Entry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
Entry(java.lang.String file) throws java.io.FileNotFoundException
file
- name of the file to which the changed shall apply.
new java.io.File(file).exists() must return true.
java.io.FileNotFoundException
- if file is not the name of an existing file
java.lang.NullPointerException
- if file is null
Entry(java.lang.String prefix, java.lang.String content, java.lang.String postfix, java.lang.String file, java.lang.String mark, java.lang.String alignment, java.lang.String append, java.lang.String isRegex, java.lang.String label) throws java.io.FileNotFoundException
prefix
- first part of the text that is inserted. It can not be
changed. May be null.content
- middle part of the text to be inserted. It can be changed
in several ways (getDocument()
,
setContent(String)
,
changeContent(String)
). May be null.postfix
- third part of the text to be inserted. It can not be
changed. May be null.file
- name of the file to which the changed shall apply.
new java.io.File(file).exists() must return true.mark
- a string in the file that marks the position where the
prefix, content and postfix shall be inserted.alignment
- the alignment for the content in the format
leftAlignment,rightAlignment. The text of the
content will have leftAlignment spaces in the
beginning of each line and will break at the first
space after rightAlignment. May be null for an
unaligned String.append
- "-1" or null to insert the new text before the
mark,
"0" to replace the mark with the new text,
"1" to insert the new text after the mark.isRegex
- "0" or null if mark is not a regular expression,
"1" if mark is a regular expression.label
- a label with no important meaning. Used to label the
EntryPanel.
java.io.FileNotFoundException
- if file is not the name of an existing file
java.lang.NullPointerException
- if file is null
java.lang.NumberFormatException
- if alignment string has a bad formatMethod Detail |
void accept(TextVisitor v)
v.visit(this)
on the argument.
If the TextVisitor has already visited this Entry,
then it is rejected unless the text has been
changed in the meantime by setContent(String)
.
v
- the TextVisitor that shall visit this Entry.setContent(String)
,
changeContent(String)
void setContent(java.lang.String s)
changeContent(String)
,
accept(TextVisitor)
final void changeContent(java.lang.String s)
setContent(String)
,
accept(TextVisitor)
java.lang.String getPrefix()
java.lang.String getPostfix()
javax.swing.text.Document getDocument()
Document
will also change this Entry's
content and vice versa.
EntryPanel
java.lang.String getContent()
java.lang.String getMark()
java.io.File getFile()
int getLeftAlignment()
int getRightAlignment()
java.lang.String getAppend()
boolean isRegex()
java.lang.String getLabel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |