All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bndtools.templating.util.BaseOCD Maven / Gradle / Ivy

The newest version!
package org.bndtools.templating.util;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

import org.osgi.service.metatype.ObjectClassDefinition;

public abstract class BaseOCD implements ObjectClassDefinition {

	private final String	name;
	private final String	description;
	private final URI		iconUri;

	public BaseOCD(String name, String description, URI iconUri) {
		this.name = name;
		this.description = description;
		this.iconUri = iconUri;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getID() {
		return name;
	}

	@Override
	public String getDescription() {
		return description;
	}

	@Override
	public InputStream getIcon(int size) throws IOException {
		return iconUri != null ? iconUri.toURL()
			.openStream() : null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy