| /******************************************************************************* |
| * Copyright (c) 2014 Bosch Software Innovations GmbH and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * and Eclipse Distribution License v1.0 which accompany this distribution. |
| * |
| * The Eclipse Public License is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * The Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * Bosch Software Innovations GmbH - Please refer to git log |
| * |
| *******************************************************************************/ |
| package org.eclipse.vorto.api.common.generation; |
| |
| import org.eclipse.vorto.functionblock.FunctionblockModel; |
| |
| import com.google.common.base.Strings; |
| |
| |
| public class FunctionBlockMetaData { |
| public static final String FB_DEFAULT_VERSION = "1.0.0"; |
| public static final String DEFAULT_ARCHITECT_PRFIX = "com.bosch.functionblock."; |
| |
| private String name; |
| private String displayName; |
| private String version; |
| private String category; |
| private String vendor; |
| private String description; |
| private String groupName; |
| private FunctionblockModel fbm; |
| |
| public FunctionBlockMetaData(String name) { |
| this.name = name; |
| this.displayName = name; |
| this.version = FB_DEFAULT_VERSION; |
| this.category = "demo"; |
| this.vendor = "www.bosch.com"; |
| this.description = "Function block model for " + name; |
| this.groupName = ""; |
| } |
| |
| public String getName() { |
| return name; |
| } |
| |
| public void setName(String name) { |
| this.name = name; |
| } |
| |
| public String getDisplayName() { |
| return displayName; |
| } |
| |
| public void setDisplayName(String displayName) { |
| this.displayName = displayName; |
| } |
| |
| public String getVersion() { |
| return version; |
| } |
| |
| public void setVersion(String version) { |
| this.version = version; |
| } |
| |
| public String getCategory() { |
| return category; |
| } |
| |
| public void setCategory(String category) { |
| this.category = category; |
| } |
| |
| public String getVendor() { |
| return vendor; |
| } |
| |
| public void setVendor(String vendor) { |
| this.vendor = vendor; |
| } |
| |
| public String getDescription() { |
| return description; |
| } |
| |
| public void setDescription(String description) { |
| this.description = description; |
| } |
| |
| public String getDefaultGroupId() { |
| return DEFAULT_ARCHITECT_PRFIX + this.category; |
| } |
| |
| public void validate() { |
| |
| } |
| |
| public String toString() { |
| return "FbName=" + this.name; |
| } |
| |
| public String getGroupName() { |
| if (Strings.isNullOrEmpty(groupName)) |
| return getDefaultGroupId(); |
| return groupName; |
| } |
| |
| public void setGroupName(String groupName) { |
| this.groupName = groupName; |
| } |
| |
| public FunctionblockModel getFbm() { |
| return fbm; |
| } |
| |
| public void setFbm(FunctionblockModel fbm) { |
| this.fbm = fbm; |
| } |
| |
| } |