mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-26 12:11:33 +01:00
Bump spotless and fix formatting (#3469)
Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
parent
7bad9baa85
commit
9289fd5a78
@ -54,18 +54,19 @@ import com.igormaznitsa.jbbp.model.JBBPFieldUShort;
|
||||
*
|
||||
* Parser rules follows Java Binary Block Parser syntax.
|
||||
*
|
||||
* <p>
|
||||
* <p />
|
||||
*
|
||||
* See details from <a href=
|
||||
* "https://github.com/raydac/java-binary-block-parser">https://github.com/raydac/java-binary-block-parser</a>
|
||||
*
|
||||
* <p>
|
||||
* <p />
|
||||
* Usage example:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* JsonObject json = new Bin2Json("byte a; byte b; ubyte c;").convert("03FAFF");
|
||||
* json.toString() = {"a":3,"b":-6,"c":255}
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* @author Pauli Anttila - Initial contribution
|
||||
|
@ -38,5 +38,4 @@ public class ItemRuntimeActivator implements ModelParser {
|
||||
public String getExtension() {
|
||||
return "items";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
*/
|
||||
package org.openhab.core.model.internal.valueconverter;
|
||||
|
||||
import org.openhab.core.model.core.valueconverter.ValueTypeToStringConverter;
|
||||
import org.eclipse.xtext.common.services.DefaultTerminalConverters;
|
||||
import org.eclipse.xtext.conversion.IValueConverter;
|
||||
import org.eclipse.xtext.conversion.ValueConverter;
|
||||
import org.openhab.core.model.core.valueconverter.ValueTypeToStringConverter;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
@ -33,5 +33,4 @@ public class ItemValueConverters extends DefaultTerminalConverters {
|
||||
public IValueConverter<Object> ValueType() {
|
||||
return valueTypeToStringConverter;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,5 +28,4 @@ public class BindingConfigParseException extends Exception {
|
||||
public BindingConfigParseException(String msg, Exception e) {
|
||||
super(msg, e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -517,5 +517,4 @@ public class GenericItemProvider extends AbstractProvider<Item>
|
||||
public @Nullable StateDescriptionFragment getStateDescriptionFragment(String itemName, @Nullable Locale locale) {
|
||||
return stateDescriptionFragments.get(itemName);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -88,7 +88,8 @@ public class GenericMetadataProvider extends AbstractProvider<Metadata> implemen
|
||||
* Removes all meta-data for a given item
|
||||
*
|
||||
* @param itemName the item name
|
||||
*/public void removeMetadataByItemName(String itemName) {
|
||||
*/
|
||||
public void removeMetadataByItemName(String itemName) {
|
||||
Set<Metadata> toBeRemoved;
|
||||
try {
|
||||
lock.writeLock().lock();
|
||||
@ -101,6 +102,7 @@ public class GenericMetadataProvider extends AbstractProvider<Metadata> implemen
|
||||
notifyListenersAboutRemovedElement(m);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Metadata> getAll() {
|
||||
try {
|
||||
@ -110,5 +112,4 @@ public class GenericMetadataProvider extends AbstractProvider<Metadata> implemen
|
||||
lock.readLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,5 +38,4 @@ public class PersistenceRuntimeActivator implements ModelParser {
|
||||
public String getExtension() {
|
||||
return "persist";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,17 +16,6 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.openhab.core.persistence.PersistenceManager;
|
||||
import org.openhab.core.persistence.PersistenceService;
|
||||
import org.openhab.core.persistence.PersistenceServiceConfiguration;
|
||||
import org.openhab.core.persistence.PersistenceFilter;
|
||||
import org.openhab.core.persistence.PersistenceItemConfiguration;
|
||||
import org.openhab.core.persistence.config.PersistenceAllConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceGroupConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceItemConfig;
|
||||
import org.openhab.core.persistence.strategy.PersistenceCronStrategy;
|
||||
import org.openhab.core.persistence.strategy.PersistenceStrategy;
|
||||
import org.openhab.core.model.core.EventType;
|
||||
import org.openhab.core.model.core.ModelRepository;
|
||||
import org.openhab.core.model.core.ModelRepositoryChangeListener;
|
||||
@ -38,6 +27,17 @@ import org.openhab.core.model.persistence.persistence.ItemConfig;
|
||||
import org.openhab.core.model.persistence.persistence.PersistenceConfiguration;
|
||||
import org.openhab.core.model.persistence.persistence.PersistenceModel;
|
||||
import org.openhab.core.model.persistence.persistence.Strategy;
|
||||
import org.openhab.core.persistence.PersistenceFilter;
|
||||
import org.openhab.core.persistence.PersistenceItemConfiguration;
|
||||
import org.openhab.core.persistence.PersistenceManager;
|
||||
import org.openhab.core.persistence.PersistenceService;
|
||||
import org.openhab.core.persistence.PersistenceServiceConfiguration;
|
||||
import org.openhab.core.persistence.config.PersistenceAllConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceGroupConfig;
|
||||
import org.openhab.core.persistence.config.PersistenceItemConfig;
|
||||
import org.openhab.core.persistence.strategy.PersistenceCronStrategy;
|
||||
import org.openhab.core.persistence.strategy.PersistenceStrategy;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
|
||||
@ -170,5 +170,4 @@ public class PersistenceModelManager implements ModelRepositoryChangeListener {
|
||||
private PersistenceFilter mapFilter(Filter filter) {
|
||||
return new PersistenceFilter();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,12 +20,12 @@ import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
|
||||
import org.openhab.core.model.persistence.persistence.Strategy;
|
||||
import org.eclipse.xtext.resource.EObjectDescription;
|
||||
import org.eclipse.xtext.resource.IEObjectDescription;
|
||||
import org.eclipse.xtext.scoping.IScope;
|
||||
import org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider;
|
||||
import org.eclipse.xtext.scoping.impl.SimpleScope;
|
||||
import org.openhab.core.model.persistence.persistence.Strategy;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
@ -53,5 +53,4 @@ public class PersistenceGlobalScopeProvider extends AbstractGlobalScopeProvider
|
||||
}
|
||||
return new SimpleScope(parentScope, descs);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -94,7 +94,5 @@ public class RuleContextHelper {
|
||||
public IEvaluationContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,5 +49,4 @@ public class RuleEvaluationContext extends DefaultEvaluationContext {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -56,12 +56,10 @@ public class RulesClassFinder extends ClassFinder {
|
||||
cache.put(name, NULL_CLASS);
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<?> forName(String name, ClassLoader classLoader) throws ClassNotFoundException {
|
||||
return Class.forName(name, false, classLoader);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -165,7 +165,8 @@ public class DSLScriptEngine implements javax.script.ScriptEngine {
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> cachePreset = scriptExtensionAccessor.findPreset("cache", (String) context.getAttribute("oh.engine-identifier", ScriptContext.ENGINE_SCOPE));
|
||||
Map<String, Object> cachePreset = scriptExtensionAccessor.findPreset("cache",
|
||||
(String) context.getAttribute("oh.engine-identifier", ScriptContext.ENGINE_SCOPE));
|
||||
evalContext.newValue(QualifiedName.create("sharedCache"), cachePreset.get("sharedCache"));
|
||||
evalContext.newValue(QualifiedName.create("privateCache"), cachePreset.get("privateCache"));
|
||||
// now add specific implicit vars, where we have to map the right content
|
||||
@ -211,7 +212,6 @@ public class DSLScriptEngine implements javax.script.ScriptEngine {
|
||||
|
||||
@Override
|
||||
public void put(String key, Object value) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -240,7 +240,6 @@ public class DSLScriptEngine implements javax.script.ScriptEngine {
|
||||
|
||||
@Override
|
||||
public void setContext(ScriptContext context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -308,5 +307,4 @@ public class DSLScriptEngine implements javax.script.ScriptEngine {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,8 @@ public class DSLScriptEngineFactory implements ScriptEngineFactory {
|
||||
protected @Nullable DSLScriptContextProvider contextProvider;
|
||||
|
||||
@Activate
|
||||
public DSLScriptEngineFactory(@Reference ScriptEngine scriptEngine, @Reference ScriptExtensionAccessor scriptExtensionAccessor) {
|
||||
public DSLScriptEngineFactory(@Reference ScriptEngine scriptEngine,
|
||||
@Reference ScriptExtensionAccessor scriptExtensionAccessor) {
|
||||
this.scriptEngine = scriptEngine;
|
||||
this.scriptExtensionAccessor = scriptExtensionAccessor;
|
||||
}
|
||||
@ -63,5 +64,4 @@ public class DSLScriptEngineFactory implements ScriptEngineFactory {
|
||||
public javax.script.@Nullable ScriptEngine createScriptEngine(String scriptType) {
|
||||
return new DSLScriptEngine(scriptEngine, contextProvider, scriptExtensionAccessor);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ import org.openhab.core.items.ItemNotFoundException;
|
||||
import org.openhab.core.items.ItemRegistry;
|
||||
import org.openhab.core.library.CoreItemFactory;
|
||||
import org.openhab.core.model.script.internal.engine.action.SemanticsActionService;
|
||||
import org.openhab.core.semantics.model.equipment.CleaningRobot;
|
||||
import org.openhab.core.semantics.model.equipment.Battery;
|
||||
import org.openhab.core.semantics.model.equipment.CleaningRobot;
|
||||
import org.openhab.core.semantics.model.location.Bathroom;
|
||||
import org.openhab.core.semantics.model.location.Indoor;
|
||||
|
||||
|
@ -31,5 +31,4 @@ public class OptimizingFeatureScopeTrackerProvider2 extends OptimizingFeatureSco
|
||||
return new FeatureScopeTracker() {
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -162,5 +162,4 @@ public class ScriptServiceUtil {
|
||||
// uninjected as a callback from the script engine, not via DS as it is a circular dependency...
|
||||
this.scriptEngine.compareAndSet(scriptEngine, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
package org.openhab.core.model.script;
|
||||
|
||||
import org.openhab.core.items.ItemRegistry;
|
||||
import org.openhab.core.thing.ThingRegistry;
|
||||
import org.openhab.core.model.core.ModelRepository;
|
||||
import org.openhab.core.model.script.engine.IActionServiceProvider;
|
||||
import org.openhab.core.model.script.engine.IThingActionsProvider;
|
||||
@ -22,6 +21,7 @@ import org.openhab.core.model.script.internal.engine.ServiceTrackerActionService
|
||||
import org.openhab.core.model.script.internal.engine.ServiceTrackerThingActionsProvider;
|
||||
import org.openhab.core.model.script.script.Script;
|
||||
import org.openhab.core.model.script.script.impl.ScriptImpl;
|
||||
import org.openhab.core.thing.ThingRegistry;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Module;
|
||||
@ -52,5 +52,4 @@ public class ServiceModule implements Module {
|
||||
binder.bind(IThingActionsProvider.class).toInstance(new ServiceTrackerThingActionsProvider(scriptServiceUtil));
|
||||
binder.bind(Script.class).to(ScriptImpl.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ public class Audio {
|
||||
|
||||
/**
|
||||
* Converts a float volume to a {@link PercentType} volume and checks if float volume is in the [0;1] range.
|
||||
*
|
||||
* @param volume
|
||||
* @return
|
||||
*/
|
||||
|
@ -24,10 +24,10 @@ import org.openhab.core.items.Item;
|
||||
import org.openhab.core.items.ItemNotFoundException;
|
||||
import org.openhab.core.items.ItemRegistry;
|
||||
import org.openhab.core.items.events.ItemEventFactory;
|
||||
import org.openhab.core.model.script.ScriptServiceUtil;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.types.TypeParser;
|
||||
import org.openhab.core.model.script.ScriptServiceUtil;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
|
@ -194,5 +194,4 @@ public class Ephemeris {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -56,5 +56,4 @@ public class Exec {
|
||||
public static String executeCommandLine(Duration timeout, String... commandLine) {
|
||||
return ExecUtil.executeCommandLineAndWaitResponse(timeout, commandLine);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -80,5 +80,4 @@ public class Log {
|
||||
static public void logError(String loggerName, String format, Object... args) {
|
||||
LoggerFactory.getLogger(LOGGER_NAME_PREFIX.concat(loggerName)).error(format, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,5 +62,4 @@ public class Ping {
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
*/
|
||||
package org.openhab.core.model.script.actions;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.eclipse.xtext.xbase.XExpression;
|
||||
@ -26,8 +28,6 @@ import org.openhab.core.model.script.internal.engine.action.ScriptExecutionActio
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
/**
|
||||
* The {@link ScriptExecution} is a wrapper for the ScriptExecution actions
|
||||
*
|
||||
@ -78,17 +78,23 @@ public class ScriptExecution {
|
||||
}
|
||||
|
||||
@ActionDoc(text = "create an identifiable timer ")
|
||||
public static Timer createTimer(@Nullable String identifier, ZonedDateTime zonedDateTime, Procedures.Procedure0 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimer(identifier, zonedDateTime, closure::apply));
|
||||
public static Timer createTimer(@Nullable String identifier, ZonedDateTime zonedDateTime,
|
||||
Procedures.Procedure0 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimer(identifier, zonedDateTime,
|
||||
closure::apply));
|
||||
}
|
||||
|
||||
@ActionDoc(text = "create a timer with argument")
|
||||
public static Timer createTimerWithArgument(ZonedDateTime zonedDateTime, Object arg1, Procedures.Procedure1 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimerWithArgument(zonedDateTime, arg1, closure::apply));
|
||||
public static Timer createTimerWithArgument(ZonedDateTime zonedDateTime, Object arg1,
|
||||
Procedures.Procedure1 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimerWithArgument(zonedDateTime, arg1,
|
||||
closure::apply));
|
||||
}
|
||||
|
||||
@ActionDoc(text = "create an identifiable timer with argument")
|
||||
public static Timer createTimerWithArgument(@Nullable String identifier, ZonedDateTime zonedDateTime, Object arg1, Procedures.Procedure1 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimerWithArgument(identifier, zonedDateTime, arg1, closure::apply));
|
||||
public static Timer createTimerWithArgument(@Nullable String identifier, ZonedDateTime zonedDateTime, Object arg1,
|
||||
Procedures.Procedure1 closure) {
|
||||
return new Timer(ScriptExecutionActionService.getScriptExecution().createTimerWithArgument(identifier,
|
||||
zonedDateTime, arg1, closure::apply));
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,6 @@ public class Semantics {
|
||||
public static @Nullable Class<? extends Equipment> getEquipmentType(Item item) {
|
||||
Item equipmentItem = isEquipment(item) ? item : getEquipment(item);
|
||||
return equipmentItem != null ? SemanticTags.getEquipment(equipmentItem) : null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,9 +12,9 @@
|
||||
*/
|
||||
package org.openhab.core.model.script.actions;
|
||||
|
||||
import org.openhab.core.model.script.internal.engine.action.ThingActionService;
|
||||
import org.openhab.core.thing.ThingStatusInfo;
|
||||
import org.openhab.core.thing.binding.ThingActions;
|
||||
import org.openhab.core.model.script.internal.engine.action.ThingActionService;
|
||||
|
||||
/**
|
||||
* This class provides static methods that can be used in automation rules for
|
||||
|
@ -12,11 +12,11 @@
|
||||
*/
|
||||
package org.openhab.core.model.script.actions;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
/**
|
||||
* The {@link Timer} is a wrapper for the {@link org.openhab.core.automation.module.script.action.Timer}
|
||||
* interface. This is necessary because the implementation methods of an interface can't be called from
|
||||
|
@ -33,5 +33,4 @@ public class TransformationException extends Exception {
|
||||
public TransformationException(@Nullable String message, @Nullable Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -104,15 +104,13 @@ public class Voice {
|
||||
* @param volume The volume to be used
|
||||
*/
|
||||
@ActionDoc(text = "says a given text with a given voice and the given volume")
|
||||
public static void say(@ParamDoc(name = "text") Object text,
|
||||
@ParamDoc(name = "voice") @Nullable String voice,
|
||||
public static void say(@ParamDoc(name = "text") Object text, @ParamDoc(name = "voice") @Nullable String voice,
|
||||
@ParamDoc(name = "volume", text = "the volume to be used") PercentType volume) {
|
||||
say(text, voice, null, volume);
|
||||
}
|
||||
|
||||
@ActionDoc(text = "says a given text with a given voice and the given volume")
|
||||
public static void say(@ParamDoc(name = "text") Object text,
|
||||
@ParamDoc(name = "voice") @Nullable String voice,
|
||||
public static void say(@ParamDoc(name = "text") Object text, @ParamDoc(name = "voice") @Nullable String voice,
|
||||
@ParamDoc(name = "volume", text = "volume in the range [0;1]") float volume) {
|
||||
say(text, voice, null, floatVolumeToPercentType(volume));
|
||||
}
|
||||
@ -128,8 +126,7 @@ public class Voice {
|
||||
* be used
|
||||
*/
|
||||
@ActionDoc(text = "says a given text with a given voice through the given sink")
|
||||
public static void say(@ParamDoc(name = "text") Object text,
|
||||
@ParamDoc(name = "voice") @Nullable String voice,
|
||||
public static void say(@ParamDoc(name = "text") Object text, @ParamDoc(name = "voice") @Nullable String voice,
|
||||
@ParamDoc(name = "sink") @Nullable String sink) {
|
||||
say(text, voice, sink, null);
|
||||
}
|
||||
@ -209,8 +206,7 @@ public class Voice {
|
||||
*/
|
||||
@ActionDoc(text = "interprets a given text by given human language interpreter(s) and using the given sink", returns = "human language response")
|
||||
public static String interpret(@ParamDoc(name = "text") Object text,
|
||||
@ParamDoc(name = "interpreters") String interpreters,
|
||||
@ParamDoc(name = "sink") @Nullable String sink) {
|
||||
@ParamDoc(name = "interpreters") String interpreters, @ParamDoc(name = "sink") @Nullable String sink) {
|
||||
String response;
|
||||
try {
|
||||
response = VoiceActionService.voiceManager.interpret(text.toString(), interpreters);
|
||||
@ -476,6 +472,7 @@ public class Voice {
|
||||
|
||||
/**
|
||||
* Converts a float volume to a {@link PercentType} volume and checks if float volume is in the [0;1] range.
|
||||
*
|
||||
* @param volume
|
||||
* @return
|
||||
*/
|
||||
|
@ -19,5 +19,4 @@ import org.openhab.core.model.script.engine.action.ActionService;
|
||||
public interface IActionServiceProvider {
|
||||
|
||||
List<ActionService> get();
|
||||
|
||||
}
|
||||
|
@ -19,5 +19,4 @@ import org.openhab.core.thing.binding.ThingActions;
|
||||
public interface IThingActionsProvider {
|
||||
|
||||
List<ThingActions> get();
|
||||
|
||||
}
|
||||
|
@ -53,11 +53,9 @@ public class ScriptParsingException extends ScriptException {
|
||||
|
||||
public ScriptParsingException addValidationIssues(Iterable<Issue> validationErrors) {
|
||||
for (Issue validationError : validationErrors) {
|
||||
this.getErrors().add(
|
||||
new ScriptError(validationError.getMessage(), validationError.getLineNumber(), validationError
|
||||
.getOffset(), validationError.getLength()));
|
||||
this.getErrors().add(new ScriptError(validationError.getMessage(), validationError.getLineNumber(),
|
||||
validationError.getOffset(), validationError.getLength()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,5 +37,4 @@ public interface ActionService {
|
||||
* @return the action class
|
||||
*/
|
||||
Class<?> getActionClass();
|
||||
|
||||
}
|
||||
|
@ -112,5 +112,4 @@ public class RuleHumanLanguageInterpreter implements HumanLanguageInterpreter {
|
||||
public Set<String> getSupportedGrammarFormats() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,5 +35,4 @@ public class ScriptEncodingProvider implements IEncodingProvider {
|
||||
}
|
||||
return Charset.defaultCharset().name();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@
|
||||
*/
|
||||
package org.openhab.core.model.script.internal.engine.action;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.automation.module.script.action.ScriptExecution;
|
||||
@ -20,8 +22,6 @@ import org.osgi.service.component.annotations.Activate;
|
||||
import org.osgi.service.component.annotations.Component;
|
||||
import org.osgi.service.component.annotations.Reference;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* This class registers an OSGi service for the ScriptExecution action.
|
||||
*
|
||||
|
@ -116,5 +116,4 @@ public class ThingActionService implements ActionService {
|
||||
ThingActionsScope scopeAnnotation = actions.getClass().getAnnotation(ThingActionsScope.class);
|
||||
return scopeAnnotation.name();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ public class ScriptItemRefresher implements ItemRegistryChangeListener {
|
||||
|
||||
@Override
|
||||
public void updated(Item oldElement, Item element) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,15 +12,15 @@
|
||||
*/
|
||||
package org.openhab.core.model.script.jvmmodel;
|
||||
|
||||
import org.openhab.core.library.types.QuantityType;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.State;
|
||||
import org.openhab.core.model.script.script.QuantityLiteral;
|
||||
import org.eclipse.xtext.xbase.XExpression;
|
||||
import org.eclipse.xtext.xbase.typesystem.computation.ITypeComputationState;
|
||||
import org.eclipse.xtext.xbase.typesystem.computation.ITypeExpectation;
|
||||
import org.eclipse.xtext.xbase.typesystem.computation.XbaseTypeComputer;
|
||||
import org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference;
|
||||
import org.openhab.core.library.types.QuantityType;
|
||||
import org.openhab.core.model.script.script.QuantityLiteral;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.State;
|
||||
|
||||
/**
|
||||
* Calculates the type information used by Xbase to select the correct method during script execution.
|
||||
@ -61,5 +61,4 @@ public class ScriptTypeComputer extends XbaseTypeComputer {
|
||||
}
|
||||
state.acceptActualType(qt);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -395,5 +395,4 @@ public class NumberExtensions {
|
||||
private static boolean isAbstractUnitOne(QuantityType<?> left) {
|
||||
return Units.ONE.equals(left.getUnit());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -50,5 +50,4 @@ public class ScriptImportSectionNamespaceScopeProvider extends XImportSectionNam
|
||||
implicitImports.add(doCreateImportNormalizer(QUANTITY_PACKAGE, true, false));
|
||||
return implicitImports;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -90,5 +90,4 @@ public class StateAndCommandProvider {
|
||||
public Iterable<State> getAllStates() {
|
||||
return STATES;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,5 +38,4 @@ public class SitemapRuntimeActivator implements ModelParser {
|
||||
public String getExtension() {
|
||||
return "sitemap";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ package org.openhab.core.model.sitemap;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.model.core.ModelRepositoryChangeListener;
|
||||
@ -52,5 +51,4 @@ public interface SitemapProvider {
|
||||
* @param listener
|
||||
*/
|
||||
void removeModelChangeListener(ModelRepositoryChangeListener listener);
|
||||
|
||||
}
|
||||
|
@ -127,5 +127,4 @@ public class SitemapProviderImpl implements SitemapProvider, ModelRepositoryChan
|
||||
public void removeModelChangeListener(ModelRepositoryChangeListener listener) {
|
||||
modelChangeListeners.remove(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ public class SitemapConverters extends DefaultTerminalConverters {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -38,5 +38,4 @@ public class ThingRuntimeActivator implements ModelParser {
|
||||
public String getExtension() {
|
||||
return "things";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -141,5 +141,4 @@ public class GenericItemChannelLinkProvider extends AbstractProvider<ItemChannel
|
||||
public Collection<ItemChannelLink> getAll() {
|
||||
return itemChannelLinkMap.values().stream().flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,11 +28,12 @@ import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISyn
|
||||
public class ThingSyntacticSequencerExtension extends ThingSyntacticSequencer {
|
||||
|
||||
@Override
|
||||
protected void emit_ModelThing_ThingKeyword_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
|
||||
ILeafNode node = nodes != null && nodes.size() == 1 && nodes.get(0) instanceof ILeafNode ? (ILeafNode) nodes
|
||||
.get(0) : null;
|
||||
protected void emit_ModelThing_ThingKeyword_0_q(EObject semanticObject, ISynNavigable transition,
|
||||
List<INode> nodes) {
|
||||
ILeafNode node = nodes != null && nodes.size() == 1 && nodes.get(0) instanceof ILeafNode
|
||||
? (ILeafNode) nodes.get(0)
|
||||
: null;
|
||||
Keyword keyword = grammarAccess.getModelThingAccess().getThingKeyword_0();
|
||||
acceptUnassignedKeyword(keyword, keyword.getValue(), node);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,10 +12,10 @@
|
||||
*/
|
||||
package org.openhab.core.model.thing.valueconverter;
|
||||
|
||||
import org.openhab.core.model.core.valueconverter.ValueTypeToStringConverter;
|
||||
import org.eclipse.xtext.common.services.DefaultTerminalConverters;
|
||||
import org.eclipse.xtext.conversion.IValueConverter;
|
||||
import org.eclipse.xtext.conversion.ValueConverter;
|
||||
import org.openhab.core.model.core.valueconverter.ValueTypeToStringConverter;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
@ -36,5 +36,4 @@ public class ThingValueConverters extends DefaultTerminalConverters {
|
||||
public IValueConverter<String> UID() {
|
||||
return uidToStringConverter;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ package org.openhab.core.model.thing.valueconverter;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.openhab.core.thing.UID;
|
||||
import org.eclipse.xtext.conversion.IValueConverter;
|
||||
import org.eclipse.xtext.conversion.ValueConverterException;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.util.Strings;
|
||||
import org.openhab.core.thing.UID;
|
||||
|
||||
/**
|
||||
* A {@link UIDtoStringConverter} is used to create {@link UID} string
|
||||
|
@ -370,8 +370,8 @@ public class ItemRegistryImpl extends AbstractRegistry<Item, String, ItemProvide
|
||||
@Override
|
||||
public @Nullable Item remove(String itemName, boolean recursive) {
|
||||
return ((ManagedItemProvider) getManagedProvider()
|
||||
.orElseThrow(() -> new IllegalStateException("ManagedProvider is not available"))).remove(itemName,
|
||||
recursive);
|
||||
.orElseThrow(() -> new IllegalStateException("ManagedProvider is not available")))
|
||||
.remove(itemName, recursive);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
11
pom.xml
11
pom.xml
@ -77,8 +77,9 @@
|
||||
<sat.version>0.13.0</sat.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<xtext.version>2.29.0</xtext.version>
|
||||
<spotless.version>2.28.0</spotless.version>
|
||||
<spotless.eclipse.version>4.21.0</spotless.eclipse.version>
|
||||
<spotless.version>2.35.0</spotless.version>
|
||||
<spotless.eclipse.version>4.26</spotless.eclipse.version>
|
||||
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -561,7 +562,7 @@ Import-Package: \\
|
||||
<files>
|
||||
<file>openhab_wst_xml_files.prefs</file>
|
||||
</files>
|
||||
<version>${spotless.eclipse.version}</version>
|
||||
<version>${spotless.eclipse.wtp.version}</version>
|
||||
</eclipseWtp>
|
||||
<trimTrailingWhitespace/>
|
||||
<endWithNewline/>
|
||||
@ -576,7 +577,7 @@ Import-Package: \\
|
||||
<files>
|
||||
<file>openhab_wst_feature_file.prefs</file>
|
||||
</files>
|
||||
<version>${spotless.eclipse.version}</version>
|
||||
<version>${spotless.eclipse.wtp.version}</version>
|
||||
</eclipseWtp>
|
||||
<trimTrailingWhitespace/>
|
||||
<endWithNewline/>
|
||||
@ -591,7 +592,7 @@ Import-Package: \\
|
||||
<files>
|
||||
<file>openhab_wst_pom_file.prefs</file>
|
||||
</files>
|
||||
<version>${spotless.eclipse.version}</version>
|
||||
<version>${spotless.eclipse.wtp.version}</version>
|
||||
</eclipseWtp>
|
||||
<trimTrailingWhitespace/>
|
||||
<endWithNewline/>
|
||||
|
Loading…
Reference in New Issue
Block a user