Package org.ec4j.core.parser
Class EditorConfigModelHandler
java.lang.Object
org.ec4j.core.parser.AbstractValidatingHandler
org.ec4j.core.parser.EditorConfigModelHandler
- All Implemented Interfaces:
EditorConfigHandler
- Direct Known Subclasses:
LocationAwareModelHandler
A
EditorConfigHandler implementation that assemles EditorConfig instances out of the parse
notifications.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EditorConfig.Builderprotected Property.Builderprotected Section.Builderprotected final VersionFields inherited from class org.ec4j.core.parser.AbstractValidatingHandler
globStart, propertyValueStart, registry, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblankLine(ParseContext context) A blank linevoidendComment(ParseContext context, String comment) End of a comment linevoidendDocument(ParseContext context) End of a document eventvoidendProperty(ParseContext context) End of a propertyvoidendSection(ParseContext context) End of a sectionprotected voidglob(ParseContext context, Glob glob) Handle theGlobcreated out of the glob string hit recently in the underlying.editorconfigfile.protected voidname(ParseContext context, String name) Handle the given propertyname.protected voidpropertyValue(ParseContext context, PropertyType.PropertyValue<?> propValue) Handle the givenPropertyType.PropertyValue.voidstartComment(ParseContext context) Start of a comment linevoidstartDocument(ParseContext context) Start of a document eventvoidstartProperty(ParseContext context) Start of a propertyvoidstartSection(ParseContext context) Start of a sectionprotected voidtype(ParseContext context, PropertyType<?> type) Handle the givenPropertyTypeassociated with a propertynamethat has been recently hit in the underlying.editorconfigfile.Methods inherited from class org.ec4j.core.parser.AbstractValidatingHandler
endGlob, endPropertyName, endPropertyValue, normalizePropertyName, startGlob, startPropertyName, startPropertyValue
-
Field Details
-
editorConfigBuilder
-
propertyBuilder
-
sectionBuilder
-
version
-
-
Constructor Details
-
EditorConfigModelHandler
-
-
Method Details
-
blankLine
A blank line- Parameters:
context- theParseContext
-
endComment
End of a comment line- Parameters:
context- theParseContextcomment- the comment text
-
endDocument
End of a document event- Parameters:
context- theParseContext
-
endProperty
End of a property- Parameters:
context- theParseContext
-
endSection
End of a section- Parameters:
context- theParseContext
-
getEditorConfig
- Returns:
- the
EditorConfiginstance parsed out of the event stream
-
glob
Description copied from class:AbstractValidatingHandlerHandle theGlobcreated out of the glob string hit recently in the underlying.editorconfigfile. Note that this method gets called after any evetual errors related to the glob were sent toErrorHandler.- Specified by:
globin classAbstractValidatingHandler- Parameters:
context- the currentParseContextglob- theGlobto handle
-
propertyValue
Description copied from class:AbstractValidatingHandlerHandle the givenPropertyType.PropertyValue. Note that this method gets called after any evetual errors related to the value were sent toErrorHandler.- Specified by:
propertyValuein classAbstractValidatingHandler- Parameters:
context- the current parse contextpropValue- thePropertyType.PropertyValueto handle
-
startComment
Start of a comment line- Parameters:
context- theParseContext
-
startDocument
Start of a document event- Parameters:
context- theParseContext
-
startProperty
Start of a property- Parameters:
context- theParseContext
-
startSection
Start of a section- Parameters:
context- theParseContext
-
type
Description copied from class:AbstractValidatingHandlerHandle the givenPropertyTypeassociated with a propertynamethat has been recently hit in the underlying.editorconfigfile.Note that this method is called only when the given property
namehas an associatedPropertyType. If the given property name has no associatedPropertyType,AbstractValidatingHandler.name(ParseContext, String)is invoked instead.- Specified by:
typein classAbstractValidatingHandler- Parameters:
context- the current parse contexttype- thePropertyTypeto handle
-
name
Description copied from class:AbstractValidatingHandlerHandle the given propertyname.Note that this method is called only when the given property
namehas no associatedPropertyType. If the given property name has an associatedPropertyType,AbstractValidatingHandler.typeis invoked instead.- Specified by:
namein classAbstractValidatingHandler- Parameters:
context- the currentParseContextname- the property name
-