public class YamlFilter extends AbstractFilter implements IYamlHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
YAML_PARENT_INDENT_PROPERTY_NAME |
static String |
YAML_SCALAR_FLOW_PROPERTY_NAME |
static String |
YAML_SCALAR_TYPE_PROPERTY_NAME |
SUB_FILTER| Constructor and Description |
|---|
YamlFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input document.
|
ISkeletonWriter |
createSkeletonWriter()
Creates a new ISkeletonWriter object that corresponds to the type of skeleton
this filter uses.
|
EncoderManager |
getEncoderManager()
Gets the EncoderManager object for this filter.
|
Parameters |
getParameters()
Gets the current parameters for this filter.
|
void |
handleBlockSequenceNodeStart(String dash,
int indent)
Called at the start of a block sequence element (e.g., after the DASH "- test")
|
void |
handleComment(String c,
boolean insideScalar)
Handle YAML comment
process differently based on if this is inside a current TextUnit
|
void |
handleDocumentEnd(String end)
Document end token.
|
void |
handleDocumentStart(String start)
Document start token.
|
void |
handleEnd()
Called once at the end of a document.
|
void |
handleKey(Key key)
Handle YAML keys, used in resname
|
void |
handleMapEnd(boolean flow) |
void |
handleMappingElementEnd()
Called after flow or mapping element is done
|
void |
handleMapStart(boolean flow)
Handle Yaml Maps (BLOCK and FLOW)
For contextual information.
|
void |
handleMarker(String marker)
Handle separator, i.e., "," or "-"
|
void |
handleOther(String other)
Other tokens like ANCHOR, TAG, ALIAS
|
void |
handleScalar(Scalar scalar)
Handle YAML value
|
void |
handleSequenceEnd(boolean flow) |
void |
handleSequenceStart(boolean flow)
Handle YAML sequences (BLOCK and FLOW)
For contextual information.
|
void |
handleStart()
Called once at the beginning of a new document.
|
void |
handleWhitespace(String whitespace,
boolean isInsideScalar)
Handle YAML whitespace
process differently based on if this is inside a current TextUnit
|
boolean |
hasNext()
Indicates if there is an event to process.
|
protected boolean |
isUtf8Bom()
Does the input have a UTF-8 Byte Order Mark?
|
protected boolean |
isUtf8Encoding()
Is the input encoded as UTF-8?
|
Event |
next()
Gets the next event available.
|
void |
open(RawDocument input)
Opens the input document described in a give RawDocument object.
|
void |
open(RawDocument input,
boolean generateSkeleton)
Opens the input document described in a give RawDocument object, and
optionally creates skeleton information.
|
void |
setParameters(IParameters params)
Sets new parameters for this filter.
|
addConfiguration, addConfiguration, addConfiguration, addConfigurations, cancel, createEndFilterEvent, createFilterWriter, createStartFilterEvent, findConfiguration, getConfiguration, getConfigurations, getDisplayName, getDocumentId, getDocumentName, getEncoding, getFilterConfigurationMapper, getFilterWriter, getMimeType, getName, getNewlineType, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterConfigurationMapper, setFilterWriter, setGenerateSkeleton, setMimeType, setMultilingual, setName, setNewlineType, setOptions, setParentId, setSrcLoc, setTrgLocclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic static final String YAML_SCALAR_TYPE_PROPERTY_NAME
public static final String YAML_PARENT_INDENT_PROPERTY_NAME
public static final String YAML_SCALAR_FLOW_PROPERTY_NAME
public void close()
IFilterclose in interface AutoCloseableclose in interface IFilterclose in class AbstractFilterpublic boolean hasNext()
IFilterImplementer Note: The caller must be able to call this method several times without changing state.
public Event next()
IFilterpublic void open(RawDocument input)
IFilterpublic void open(RawDocument input, boolean generateSkeleton)
IFilteropen in interface IFilteropen in class AbstractFilterinput - The RawDocument object to use to open the document.generateSkeleton - true to generate the skeleton data, false otherwise.public Parameters getParameters()
IFiltergetParameters in interface IFiltergetParameters in class AbstractFilterpublic void setParameters(IParameters params)
IFiltersetParameters in interface IFiltersetParameters in class AbstractFilterparams - The new parameters to use.public EncoderManager getEncoderManager()
IFiltergetEncoderManager in interface IFiltergetEncoderManager in class AbstractFilterpublic ISkeletonWriter createSkeletonWriter()
IFiltercreateSkeletonWriter in interface IFiltercreateSkeletonWriter in class AbstractFilterprotected boolean isUtf8Encoding()
AbstractFilterisUtf8Encoding in class AbstractFilterprotected boolean isUtf8Bom()
AbstractFilterisUtf8Bom in class AbstractFilterpublic void handleStart()
IYamlHandlerhandleStart in interface IYamlHandlerpublic void handleEnd()
IYamlHandlerhandleEnd in interface IYamlHandlerpublic void handleComment(String c, boolean insideScalar)
IYamlHandlerhandleComment in interface IYamlHandlerpublic void handleKey(Key key)
IYamlHandlerhandleKey in interface IYamlHandlerpublic void handleWhitespace(String whitespace, boolean isInsideScalar)
IYamlHandlerhandleWhitespace in interface IYamlHandlerpublic void handleScalar(Scalar scalar)
IYamlHandlerhandleScalar in interface IYamlHandlerpublic void handleMapStart(boolean flow)
IYamlHandlerhandleMapStart in interface IYamlHandlerpublic void handleMapEnd(boolean flow)
handleMapEnd in interface IYamlHandlerpublic void handleSequenceStart(boolean flow)
IYamlHandlerhandleSequenceStart in interface IYamlHandlerpublic void handleSequenceEnd(boolean flow)
handleSequenceEnd in interface IYamlHandlerpublic void handleMarker(String marker)
IYamlHandlerhandleMarker in interface IYamlHandlerpublic void handleOther(String other)
IYamlHandlerhandleOther in interface IYamlHandlerpublic void handleDocumentStart(String start)
IYamlHandlerhandleDocumentStart in interface IYamlHandlerpublic void handleDocumentEnd(String end)
IYamlHandlerhandleDocumentEnd in interface IYamlHandlerpublic void handleMappingElementEnd()
IYamlHandlerhandleMappingElementEnd in interface IYamlHandlerpublic void handleBlockSequenceNodeStart(String dash, int indent)
IYamlHandlerhandleBlockSequenceNodeStart in interface IYamlHandlerCopyright © 2021. All rights reserved.