Package org.ec4j.core.parser
Class LocationAwareModelHandler
java.lang.Object
org.ec4j.core.parser.AbstractValidatingHandler
org.ec4j.core.parser.EditorConfigModelHandler
org.ec4j.core.parser.LocationAwareModelHandler
- All Implemented Interfaces:
EditorConfigHandler
An
EditorConfigHandler that stores the start and end location information to the individual model elements
using Span adapters and its subclasses.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Comments.CommentBlock.Builderprivate Comments.CommentBlocks.Builderprivate Span.Builderprivate Span.Builderprivate Span.Builderprivate Span.Builderprivate Span.Builderprivate Span.BuilderFields inherited from class org.ec4j.core.parser.EditorConfigModelHandler
editorConfigBuilder, propertyBuilder, sectionBuilder, versionFields inherited from class org.ec4j.core.parser.AbstractValidatingHandler
globStart, propertyValueStart, registry, type -
Constructor Summary
ConstructorsConstructorDescriptionLocationAwareModelHandler(PropertyTypeRegistry registry, Version version, ErrorHandler errorHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidblankLine(ParseContext context) A blank lineprivate voidvoidendComment(ParseContext context, String comment) End of a comment linevoidendDocument(ParseContext context) End of a document eventvoidendGlob(ParseContext context, String glob) End of a glob patternvoidendProperty(ParseContext context) End of a propertyvoidendPropertyName(ParseContext context, String name) End of a property namevoidendPropertyValue(ParseContext context, String value) Start of a property namevoidendSection(ParseContext context) End of a sectionvoidstartComment(ParseContext context) Start of a comment linevoidstartDocument(ParseContext context) Start of a document eventvoidstartGlob(ParseContext context) Start of a glob patternvoidstartProperty(ParseContext context) Start of a propertyvoidstartPropertyName(ParseContext context) Start of a property namevoidstartPropertyValue(ParseContext context) Start of a property valuevoidstartSection(ParseContext context) Start of a sectionMethods inherited from class org.ec4j.core.parser.EditorConfigModelHandler
getEditorConfig, glob, name, propertyValue, typeMethods inherited from class org.ec4j.core.parser.AbstractValidatingHandler
normalizePropertyName
-
Field Details
-
commentBlockBuilder
-
commentBlocksBuilder
-
commentSpan
-
globSpan
-
propertySpan
-
propertyNameSpan
-
propertyValueSpan
-
sectionSpan
-
-
Constructor Details
-
LocationAwareModelHandler
public LocationAwareModelHandler(PropertyTypeRegistry registry, Version version, ErrorHandler errorHandler)
-
-
Method Details
-
blankLine
Description copied from class:EditorConfigModelHandlerA blank line- Specified by:
blankLinein interfaceEditorConfigHandler- Overrides:
blankLinein classEditorConfigModelHandler- Parameters:
context- theParseContext
-
closeCommentBlockIfNeeded
private void closeCommentBlockIfNeeded() -
endComment
Description copied from class:EditorConfigModelHandlerEnd of a comment line- Specified by:
endCommentin interfaceEditorConfigHandler- Overrides:
endCommentin classEditorConfigModelHandler- Parameters:
context- theParseContextcomment- the comment text
-
endDocument
End of a document event- Specified by:
endDocumentin interfaceEditorConfigHandler- Overrides:
endDocumentin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
endGlob
End of a glob pattern- Specified by:
endGlobin interfaceEditorConfigHandler- Overrides:
endGlobin classAbstractValidatingHandler- Parameters:
context- theParseContextglob- the glob that ends
-
endPropertyName
End of a property name- Specified by:
endPropertyNamein interfaceEditorConfigHandler- Overrides:
endPropertyNamein classAbstractValidatingHandler- Parameters:
context- theParseContextname- the name
-
endProperty
Description copied from class:EditorConfigModelHandlerEnd of a property- Specified by:
endPropertyin interfaceEditorConfigHandler- Overrides:
endPropertyin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
endPropertyValue
Start of a property name- Specified by:
endPropertyValuein interfaceEditorConfigHandler- Overrides:
endPropertyValuein classAbstractValidatingHandler- Parameters:
context- theParseContextvalue- the value
-
endSection
End of a section- Specified by:
endSectionin interfaceEditorConfigHandler- Overrides:
endSectionin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
startComment
Start of a comment line- Specified by:
startCommentin interfaceEditorConfigHandler- Overrides:
startCommentin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
startDocument
Start of a document event- Specified by:
startDocumentin interfaceEditorConfigHandler- Overrides:
startDocumentin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
startGlob
Start of a glob pattern- Specified by:
startGlobin interfaceEditorConfigHandler- Overrides:
startGlobin classAbstractValidatingHandler- Parameters:
context- theParseContext
-
startProperty
Start of a property- Specified by:
startPropertyin interfaceEditorConfigHandler- Overrides:
startPropertyin classEditorConfigModelHandler- Parameters:
context- theParseContext
-
startPropertyName
Start of a property name- Specified by:
startPropertyNamein interfaceEditorConfigHandler- Overrides:
startPropertyNamein classAbstractValidatingHandler- Parameters:
context- theParseContext
-
startPropertyValue
Start of a property value- Specified by:
startPropertyValuein interfaceEditorConfigHandler- Overrides:
startPropertyValuein classAbstractValidatingHandler- Parameters:
context- theParseContext
-
startSection
Start of a section- Specified by:
startSectionin interfaceEditorConfigHandler- Overrides:
startSectionin classEditorConfigModelHandler- Parameters:
context- theParseContext
-