|
org.netbeans.modules.editor.guards/0 0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.spi.editor.guards.support.AbstractGuardedSectionsProvider
public abstract class AbstractGuardedSectionsProvider
The helper class that simplifies writing particular GuardedSectionsProvider
implementations. Subclasses have to implement just readSections(char[])
and writeSections(java.util.List methods.
| Nested Class Summary | |
|---|---|
class |
AbstractGuardedSectionsProvider.Result
|
| Constructor Summary | |
|---|---|
protected |
AbstractGuardedSectionsProvider(GuardedEditorSupport editor)
|
| Method Summary | |
|---|---|
Reader |
createGuardedReader(InputStream stream,
String encoding)
Creates a reader able to read persisted sections. |
Writer |
createGuardedWriter(OutputStream stream,
String encoding)
Creates a writer able to write persisted sections. |
InteriorSection |
createInteriorSection(String name,
int headerBegin,
int headerEnd,
int footerBegin,
int footerEnd)
Creates an interior section object to represent section read by the readSections. |
SimpleSection |
createSimpleSection(String name,
int begin,
int end)
Creates a simple section object to represent section read by the readSections. |
abstract AbstractGuardedSectionsProvider.Result |
readSections(char[] content)
This should be implemented to extract guarded sections out of the passed content. |
abstract char[] |
writeSections(List<GuardedSection> sections,
char[] content)
This should be implemented to persist a list of guarded sections inside the passed content. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractGuardedSectionsProvider(GuardedEditorSupport editor)
| Method Detail |
|---|
public final Reader createGuardedReader(InputStream stream, String encoding) throws UnsupportedEncodingException
GuardedSectionsProvider
createGuardedReader in interface GuardedSectionsProviderstream - stream containing persisted sectionsencoding - encoding to decode read bytes
UnsupportedEncodingExceptionpublic final Writer createGuardedWriter(OutputStream stream, String encoding) throws UnsupportedEncodingException
GuardedSectionsProvider
createGuardedWriter in interface GuardedSectionsProviderstream - stream where the output should be writtenencoding - encoding used by the writer
UnsupportedEncodingExceptionpublic abstract char[] writeSections(List<GuardedSection> sections, char[] content)
sections - guarded sections to persistcontent - content
public abstract AbstractGuardedSectionsProvider.Result readSections(char[] content)
content - content including guarded sections
public final SimpleSection createSimpleSection(String name, int begin, int end) throws BadLocationException
readSections.
name - the section namebegin - the start offsetend - the end offset
BadLocationException - if the given position does not
represent a valid location in the associated documentpublic final InteriorSection createInteriorSection(String name, int headerBegin, int headerEnd, int footerBegin, int footerEnd) throws BadLocationException
readSections.
name - the section nameheaderBegin - begin the start offset of the first guarded partheaderEnd - end the end offset of the first guarded partfooterBegin - begin the start offset of the second guarded partfooterEnd - end the end offset of the second guarded part
BadLocationException - if the given position does not
represent a valid location in the associated document
|
org.netbeans.modules.editor.guards/0 0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||