Package org.ec4j.core.parser
Class AbstractValidatingHandler
java.lang.Object
org.ec4j.core.parser.AbstractValidatingHandler
- All Implemented Interfaces:
EditorConfigHandler
- Direct Known Subclasses:
EditorConfigModelHandler,ValidatingHandler
A base class for
EditorConfigHandlers which require value and glob related errors to be passed to
ErrorHandler.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Locationprotected Locationprotected final PropertyTypeRegistryprotected PropertyType<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendGlob(ParseContext context, String globSource) End of a glob patternvoidendPropertyName(ParseContext context, String name) End of a property namevoidendPropertyValue(ParseContext context, String value) Start of a property nameprotected abstract voidglob(ParseContext context, Glob glob) Handle theGlobcreated out of the glob string hit recently in the underlying.editorconfigfile.protected abstract voidname(ParseContext context, String name) Handle the given propertyname.protected StringnormalizePropertyName(String name) Lower-cases the given propertyname.protected abstract voidpropertyValue(ParseContext context, PropertyType.PropertyValue<?> propValue) Handle the givenPropertyType.PropertyValue.voidstartGlob(ParseContext context) Start of a glob patternvoidstartPropertyName(ParseContext context) Start of a property namevoidstartPropertyValue(ParseContext context) Start of a property valueprotected abstract voidtype(ParseContext context, PropertyType<?> type) Handle the givenPropertyTypeassociated with a propertynamethat has been recently hit in the underlying.editorconfigfile.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ec4j.core.parser.EditorConfigHandler
blankLine, endComment, endDocument, endProperty, endSection, startComment, startDocument, startProperty, startSection
-
Field Details
-
globStart
-
propertyValueStart
-
registry
-
type
-
-
Constructor Details
-
AbstractValidatingHandler
-
-
Method Details
-
endGlob
End of a glob pattern- Specified by:
endGlobin interfaceEditorConfigHandler- Parameters:
context- theParseContextglobSource- the glob that ends
-
endPropertyName
End of a property name- Specified by:
endPropertyNamein interfaceEditorConfigHandler- Parameters:
context- theParseContextname- the name
-
endPropertyValue
Start of a property name- Specified by:
endPropertyValuein interfaceEditorConfigHandler- Parameters:
context- theParseContextvalue- the value
-
glob
Handle 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.- Parameters:
context- the currentParseContextglob- theGlobto handle
-
name
Handle 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,typeis invoked instead.- Parameters:
context- the currentParseContextname- the property name
-
normalizePropertyName
Lower-cases the given propertyname.- Parameters:
name- the property name to normalize- Returns:
- the normalized property name
-
propertyValue
protected abstract void propertyValue(ParseContext context, PropertyType.PropertyValue<?> propValue) Handle the givenPropertyType.PropertyValue. Note that this method gets called after any evetual errors related to the value were sent toErrorHandler.- Parameters:
context- the current parse contextpropValue- thePropertyType.PropertyValueto handle
-
startGlob
Start of a glob pattern- Specified by:
startGlobin interfaceEditorConfigHandler- Parameters:
context- theParseContext
-
startPropertyName
Start of a property name- Specified by:
startPropertyNamein interfaceEditorConfigHandler- Parameters:
context- theParseContext
-
startPropertyValue
Start of a property value- Specified by:
startPropertyValuein interfaceEditorConfigHandler- Parameters:
context- theParseContext
-
type
Handle 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,name(ParseContext, String)is invoked instead.- Parameters:
context- the current parse contexttype- thePropertyTypeto handle
-