Package org.openhab.core.converter
Interface ObjectParser<T>
- Type Parameters:
T- The object type.
- All Known Subinterfaces:
ItemParser,RootUIComponentParser,RuleParser,RuleTemplateParser,SemanticTagParser,SitemapParser,ThingParser,UIComponentParser
@NonNullByDefault
public interface ObjectParser<T>
A generic interface for parsers that parse strings into specific object types like Things, Items, Rules etc.
- Author:
- Ravi Nadahar - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionvoidfinishParsingFormat(String modelName) Release the resources from a previously started format parsing.Collection<? extends T> getParsedObjects(String modelName) Get a copy of the collection of objects that were found when parsing the format.Get the name of the format.@Nullable StringParse the provided syntax in format without impacting any object registries.
-
Method Details
-
getParserFormat
String getParserFormat()Get the name of the format.- Returns:
- The format name.
-
startParsingFormat
Parse the provided syntax in format without impacting any object registries. -
getParsedObjects
Get a copy of the collection of objects that were found when parsing the format.- Parameters:
modelName- the model name whose objects to get.- Returns:
- The
Collectionof objects. - Implementation note:
- It's important that a copy of the
Collectionis returned, so that invokingfinishParsingFormat(String)doesn't modify the returned result.
-
finishParsingFormat
Release the resources from a previously started format parsing.- Parameters:
modelName- the model name whose resources to release.
-