|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.wurbelizer.SourceElement
public class SourceElement
A SourceElement represents a section within a SourceDocument.
Source elements belong to one of five categories (types):
SourceSubElements.
There are two kinds of sub elements: single-line and multi-line.
Single line sub elements end at the end of the line where they started. A wurblet
anchor is a single line sub element. Single line sub elements may be enlarged
beyond the end of the line by a continuation line (double backslash at the end of line).
Multi-line sub elements like here- or property-documents are terminated a special
control sequence. Furthermore, all leading comment text starting each line will
be cut off and will not become part of the contents of the sub element (works like a
rectangular cut).
| Nested Class Summary | |
|---|---|
static class |
SourceElement.Type
type of source element |
| Constructor Summary | |
|---|---|
SourceElement(SourceDocument doc,
SourceElement.Type type,
int begin,
int end)
Creates a source element. |
|
| Method Summary | |
|---|---|
boolean |
containsHereDocuments()
Checks whether this element contains here-documents. |
boolean |
containsPropertyDocuments()
Checks whether this element contains property documents. |
boolean |
containsWurblets()
Checks whether this element contains wurblets. |
void |
deleteText(int startNdx,
int endNdx)
Removes characters in text and updates doc and all other elements. |
int |
getBegin()
Gets the start/begin offset of this element within its document. |
int |
getEnd()
Gets the end offset of this element within its document. |
String |
getGuardedName()
Gets the guarded name if this is a guarded block. |
List<SourceHereSubElement> |
getHereDocuments()
Gets the list of here-documents. |
List<SourcePropertySubElement> |
getPropertyDocuments()
Gets the list of property documents. |
SourceDocument |
getSourceDocument()
Gets the SourceDocument this element belongs to. |
String |
getText()
Gets the contents of this element |
SourceElement.Type |
getType()
Gets the type of this source element. |
List<SourceWurbletSubElement> |
getWurblets()
Gets the list of wurblets. |
boolean |
isCode()
Checks whether this element is a code block. |
boolean |
isComment()
Checks whether this element is a comment. |
boolean |
isGuarded()
Checks whether this element is a guarded block. |
boolean |
isWhiteEmpty()
Checks whether this element contains only whitespaces. |
void |
setBegin(int begin)
Sets the start/begin offset of this element within its document. |
void |
setEnd(int end)
Sets the end offset of this element within its document. |
void |
setGuardedName(String guardedName)
Sets the guarded name if this is a guarded block. |
String |
toString()
Prints the name and line info of the element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SourceElement(SourceDocument doc,
SourceElement.Type type,
int begin,
int end)
throws SourceException
doc - the source document the element belongs totype - the element's type, one one TYPE_....begin - the start of the element within the documentend - the end of the element
SourceException - if creating the element failed| Method Detail |
|---|
public String getText()
public boolean isCode()
public boolean isGuarded()
public boolean isComment()
public boolean containsWurblets()
public List<SourceWurbletSubElement> getWurblets()
public boolean containsHereDocuments()
public List<SourceHereSubElement> getHereDocuments()
public boolean containsPropertyDocuments()
public List<SourcePropertySubElement> getPropertyDocuments()
public boolean isWhiteEmpty()
public SourceDocument getSourceDocument()
SourceDocument this element belongs to.
public SourceElement.Type getType()
public int getBegin()
public void setBegin(int begin)
begin - the start of this elementpublic int getEnd()
public void setEnd(int end)
end - the end of this element
public void deleteText(int startNdx,
int endNdx)
startNdx - the offset to start (relative to the element)endNdx - the offset to end (relative to the element)public String getGuardedName()
public void setGuardedName(String guardedName)
guardedName - the guardedname of this comment blockpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||