|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsrc2xml.ElementReader
public class ElementReader
ElementReader is a class that represents the generic reader of a source region (element), that is what identifies and stores a particular region in the source code.
It uses two Detectors to recognize the start and the end of the region.
Detector
Field Summary | |
---|---|
protected java.lang.String |
content
|
java.lang.String |
end_pattern
|
java.lang.String |
id
|
java.lang.String |
nested_bag
|
boolean |
nested_only
|
java.lang.String |
start_pattern
|
Constructor Summary | |
---|---|
ElementReader(java.lang.String sid,
Detector st,
Detector en,
java.lang.String sptn,
java.lang.String eptn,
boolean nes)
Class constructor |
Method Summary | |
---|---|
void |
AddNested(ElementReader e)
Add a new nested region, that is an ElementReader that might be contained in this one |
boolean |
Ends(Source src)
Detects the end of read region, invoking the corresponding Detector |
java.lang.String |
generateCSS()
Generate an estimated CSS based on child IDs |
Element |
Read(Source src)
Read an element from source |
boolean |
Triggers(Source src)
Tells if this region starts at current, position in source, invoking the corresponding Detector |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String id
protected java.lang.String content
public java.lang.String nested_bag
public boolean nested_only
public java.lang.String start_pattern
public java.lang.String end_pattern
Constructor Detail |
---|
public ElementReader(java.lang.String sid, Detector st, Detector en, java.lang.String sptn, java.lang.String eptn, boolean nes)
sid
- An IDentificative String for this readerst
- The element (region) start Detectoren
- The element (region) end Detectorsptn
- The exported region starting tag pattern - use var (id)eptn
- The exported region ending tag pattern - use var (id)nes
- A boolean true if read elements can appear only as
nested in other elementsDetector
Method Detail |
---|
public Element Read(Source src) throws java.io.IOException
src
- The source stream
java.io.IOException
- If an input or output
exception occurredSource
,
Element
public boolean Triggers(Source src) throws java.io.IOException
src
- The source stream
java.io.IOException
- If an input or output exception occurredSource
,
Detector
public boolean Ends(Source src) throws java.io.IOException
src
- The source stream
java.io.IOException
- If an input or output exception occurredSource
,
Detector
public void AddNested(ElementReader e)
e
- An ElementReader expected to be nestedpublic java.lang.String generateCSS()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |