@Override public String toString() { return getVersion(); } }
public String getFullVersion(){ String version = getBaseVersion(); version = attachMaintainanceVersion(version); version = attachVersionData(version); version = attachBuildType(version); return version; }
private String attachMaintainanceVersion(String version) { if (getMaintenanceVersion()!=null){ version+="."+getMaintenanceVersion(); } return version; }
public String getVersion(){ String version = getBaseVersion(); version = attachVersionData(version); return version; }
public String getBaseVersion() { String version=getMajorVersion().toString()+"."+getMinorVersion(); return version; }
private String attachVersionData(String version) { if (getVersionData()!=null){ version+="-"+getVersionData(); } return version; }
private String attachBuildType(String version) { if (getBuildType()!=null){ version+="-"+getBuildType().name(); } return version; }
public JsonObject toJSON() { JsonObject workflowRoot = new JsonObject(); JsonObject workflow = new JsonObject(); workflowRoot.add(WORKFLOW_TAG, workflow); workflow.addProperty(VERSION_ATTRIBUTE, ApplicationVersion.VERSION.getVersion()); workflow.add(GraphSchema.GRAPH_TAG, this.graph.toJSON()); if (this.image != null) { try { workflow.addProperty(IMAGE_TAG, getBase64String()); } catch (IOException e) { logger.error("Failed to attached image to workflow description", e); } } return workflowRoot; }
@Override public JsonObject toJSON() { JsonObject graphObject = new JsonObject(); graphObject.addProperty(GraphSchema.XBAYA_VERSION_ATTRIBUTE, ApplicationVersion.VERSION.getVersion()); graphObject.addProperty(GraphSchema.GRAPH_ID_TAG, getID()); graphObject.addProperty(GraphSchema.GRAPH_NAME_TAG, getName()); graphObject.addProperty(GraphSchema.GRAPH_DESCRIPTION_TAG, getDescription()); JsonArray nodeArray = new JsonArray(); for (NodeImpl node : this.nodes) { nodeArray.add(node.toJSON()); } graphObject.add(GraphSchema.NODE_TAG, nodeArray); JsonArray portArray = new JsonArray(); for (PortImpl port : this.ports) { portArray.add(port.toJSON()); } graphObject.add(GraphSchema.PORT_TAG, portArray); JsonArray edgeArray = new JsonArray(); for (EdgeImpl edge : this.edges) { edgeArray.add(edge.toJSON()); } graphObject.add(GraphSchema.EDGE_TAG, edgeArray); return graphObject; }
workflowElement.setAttributeValue(NS_XWF, VERSION_ATTRIBUTE, ApplicationVersion.VERSION.getVersion());
graphElement.setAttributeValue(GraphSchema.NS, GraphSchema.XBAYA_VERSION_ATTRIBUTE, ApplicationVersion.VERSION.getVersion());