- java.lang.Object
-
- org.nasdanika.cli.CommandBase
-
- org.nasdanika.cli.ContextCommand
-
- org.nasdanika.cli.DelegatingCommand
-
- org.nasdanika.emf.ResourceSetCommand
-
- org.nasdanika.emf.ModelCommand<T>
-
- Direct Known Subclasses:
AdapterModelCommand
public abstract class ModelCommand<T extends EObject> extends ResourceSetCommand
Loads a model from URL, optionally validates it and then passes to consumer.- Author:
- Pavel
-
-
Constructor Summary
Constructors Constructor Description ModelCommand()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Supplier<T>
createSupplier(Context context)
static void
dumpDiagnostic(Diagnostic d, int indent)
protected CommandFactory
getCommandFactory()
Supplier to Consumer.protected abstract ConsumerFactory<T>
getConsumerFactory()
protected void
reportException(Exception e)
-
Methods inherited from class org.nasdanika.emf.ResourceSetCommand
createEmptyResourceSet, createResourceSet, getEPackages
-
Methods inherited from class org.nasdanika.cli.DelegatingCommand
call, createContext
-
Methods inherited from class org.nasdanika.cli.ContextCommand
getContextBuilders, load, loadJson, loadProperties, loadYaml, newContext
-
-
-
-
Constructor Detail
-
ModelCommand
public ModelCommand()
-
-
Method Detail
-
getConsumerFactory
protected abstract ConsumerFactory<T> getConsumerFactory()
- Returns:
- Consumer factory which create a consumer to pass the loaded model to.
-
createSupplier
protected Supplier<T> createSupplier(Context context)
-
getCommandFactory
protected CommandFactory getCommandFactory()
Supplier to Consumer. Supplier loads model from URL, consumer takes the model as an argument.- Specified by:
getCommandFactory
in classDelegatingCommand
-
reportException
protected void reportException(Exception e)
- Overrides:
reportException
in classDelegatingCommand
-
dumpDiagnostic
public static void dumpDiagnostic(Diagnostic d, int indent)
-
-