
com.illposed.osc.argument.handler.Activator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javaosc-java-se-addons Show documentation
Show all versions of javaosc-java-se-addons Show documentation
An Open Sound Control library implementation in Java - Java SE/non-Android addons
The newest version!
// SPDX-FileCopyrightText: 2021 Robin Vobruba
//
// SPDX-License-Identifier: BSD-3-Clause
package com.illposed.osc.argument.handler;
import com.illposed.osc.argument.ArgumentHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Allows to easily register and unregister all types in this package.
*/
public final class Activator {
private static final Logger LOG = LoggerFactory.getLogger(Activator.class);
private static final List TYPES_STATIC_COMMON;
static {
final ArrayList types = new ArrayList<>();
types.add(AwtColorArgumentHandler.INSTANCE);
types.trimToSize();
TYPES_STATIC_COMMON = Collections.unmodifiableList(types);
}
private Activator() {}
public static Map createParserTypes() {
final Map parserTypes
= new HashMap<>(TYPES_STATIC_COMMON.size() + 1);
for (final ArgumentHandler type : TYPES_STATIC_COMMON) {
parserTypes.put(type.getDefaultIdentifier(), type);
}
return parserTypes;
}
public static List createSerializerTypes() {
final List serializerTypes
= new ArrayList<>(TYPES_STATIC_COMMON.size() + 2);
serializerTypes.addAll(TYPES_STATIC_COMMON);
return serializerTypes;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy