X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.message%2Fsrc%2Forg%2Fsimantics%2Fmessage%2Finternal%2FMessageDataSchemeExtension.java;h=7a84236542aab7ee5ec9280303d871b894588ab2;hp=db7ff82bcd7acbcce67da3e571f8fc495ddf4002;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.message/src/org/simantics/message/internal/MessageDataSchemeExtension.java b/bundles/org.simantics.message/src/org/simantics/message/internal/MessageDataSchemeExtension.java index db7ff82bc..7a8423654 100644 --- a/bundles/org.simantics.message/src/org/simantics/message/internal/MessageDataSchemeExtension.java +++ b/bundles/org.simantics.message/src/org/simantics/message/internal/MessageDataSchemeExtension.java @@ -1,96 +1,96 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.message.internal; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.simantics.message.IMessageDataSchemeExtension; -import org.simantics.message.IMessageSchemeHandler; -import org.simantics.message.IReferenceSerializer; - -/** - * @author Tuukka Lehtonen - */ -public class MessageDataSchemeExtension implements IMessageDataSchemeExtension { - - private final IConfigurationElement schemeElement; - private final String id; - private final String scheme; - private final String description; - private IConfigurationElement handlerElement; - - public MessageDataSchemeExtension(IConfigurationElement el, String id, String scheme, String description) { - this.schemeElement = el; - this.id = id; - this.scheme = scheme; - this.description = description; - } - - public IConfigurationElement getSchemeElement() { - return schemeElement; - } - - public IConfigurationElement getHandlerElement() { - return handlerElement; - } - - public void setHandlerElement(IConfigurationElement handlerElement) { - this.handlerElement = handlerElement; - } - - /* (non-Javadoc) - * @see org.simantics.message.IMessageDataSchemeExtension#getId() - */ - public String getId() { - return id; - } - - /* (non-Javadoc) - * @see org.simantics.message.IMessageDataSchemeExtension#getScheme() - */ - public String getScheme() { - return scheme; - } - - /* (non-Javadoc) - * @see org.simantics.message.IMessageDataSchemeExtension#getDescription() - */ - public String getDescription() { - return description; - } - - /* (non-Javadoc) - * @see org.simantics.message.IMessageDataSchemeExtension#getHandler() - */ - public IMessageSchemeHandler getHandler() { - if (handlerElement == null) - return null; - - try { - return (IMessageSchemeHandler) handlerElement.createExecutableExtension("handler"); - } catch (CoreException e) { - throw new RuntimeException(e); - } - } - - /* (non-Javadoc) - * @see org.simantics.message.IMessageDataSchemeExtension#getSerializer() - */ - public IReferenceSerializer getSerializer() { - try { - return (IReferenceSerializer) schemeElement.createExecutableExtension("serializer"); - } catch (CoreException e) { - throw new RuntimeException(e); - } - } - +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.message.internal; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.simantics.message.IMessageDataSchemeExtension; +import org.simantics.message.IMessageSchemeHandler; +import org.simantics.message.IReferenceSerializer; + +/** + * @author Tuukka Lehtonen + */ +public class MessageDataSchemeExtension implements IMessageDataSchemeExtension { + + private final IConfigurationElement schemeElement; + private final String id; + private final String scheme; + private final String description; + private IConfigurationElement handlerElement; + + public MessageDataSchemeExtension(IConfigurationElement el, String id, String scheme, String description) { + this.schemeElement = el; + this.id = id; + this.scheme = scheme; + this.description = description; + } + + public IConfigurationElement getSchemeElement() { + return schemeElement; + } + + public IConfigurationElement getHandlerElement() { + return handlerElement; + } + + public void setHandlerElement(IConfigurationElement handlerElement) { + this.handlerElement = handlerElement; + } + + /* (non-Javadoc) + * @see org.simantics.message.IMessageDataSchemeExtension#getId() + */ + public String getId() { + return id; + } + + /* (non-Javadoc) + * @see org.simantics.message.IMessageDataSchemeExtension#getScheme() + */ + public String getScheme() { + return scheme; + } + + /* (non-Javadoc) + * @see org.simantics.message.IMessageDataSchemeExtension#getDescription() + */ + public String getDescription() { + return description; + } + + /* (non-Javadoc) + * @see org.simantics.message.IMessageDataSchemeExtension#getHandler() + */ + public IMessageSchemeHandler getHandler() { + if (handlerElement == null) + return null; + + try { + return (IMessageSchemeHandler) handlerElement.createExecutableExtension("handler"); + } catch (CoreException e) { + throw new RuntimeException(e); + } + } + + /* (non-Javadoc) + * @see org.simantics.message.IMessageDataSchemeExtension#getSerializer() + */ + public IReferenceSerializer getSerializer() { + try { + return (IReferenceSerializer) schemeElement.createExecutableExtension("serializer"); + } catch (CoreException e) { + throw new RuntimeException(e); + } + } + } \ No newline at end of file