Search in sources :

Example 1 with XTPlan

use of org.eclipse.winery.model.tosca.xml.XTPlan in project winery by eclipse.

the class ToCanonical method convert.

private TExportedOperation convert(XTExportedOperation xml) {
    TExportedOperation canonical = new TExportedOperation(xml.getName());
    if (xml.getNodeOperation() != null) {
        canonical.setNodeOperation(convert(xml.getNodeOperation()));
    }
    if (xml.getRelationshipOperation() != null) {
        canonical.setRelationshipOperation(convert(xml.getRelationshipOperation()));
    }
    if (xml.getPlan() != null) {
        TExportedOperation.Plan plan = new TExportedOperation.Plan();
        if (xml.getPlan().getPlanRef() instanceof String) {
            plan.setPlanRef(xml.getPlan().getPlanRef());
        } else {
            plan.setPlanRef(convert((XTPlan) xml.getPlan().getPlanRef()));
        }
        canonical.setPlan(plan);
    }
    return canonical;
}
Also used : XTPlan(org.eclipse.winery.model.tosca.xml.XTPlan) XTPlan(org.eclipse.winery.model.tosca.xml.XTPlan) TPlan(org.eclipse.winery.model.tosca.TPlan) XTExportedOperation(org.eclipse.winery.model.tosca.xml.XTExportedOperation) TExportedOperation(org.eclipse.winery.model.tosca.TExportedOperation)

Example 2 with XTPlan

use of org.eclipse.winery.model.tosca.xml.XTPlan in project winery by eclipse.

the class Visitor method visit.

public void visit(XTServiceTemplate serviceTemplate) {
    Objects.requireNonNull(serviceTemplate);
    visit((XTExtensibleElements) serviceTemplate);
    final XTTopologyTemplate topologyTemplate = serviceTemplate.getTopologyTemplate();
    if (topologyTemplate != null) {
        topologyTemplate.accept(this);
    }
    final List<XTTag> tags = serviceTemplate.getTags();
    if (tags != null) {
        for (XTTag tag : tags) {
            tag.accept(this);
        }
    }
    final List<XTPlan> plans = serviceTemplate.getPlans();
    if (plans != null) {
        for (XTPlan plan : plans) {
            plan.accept(this);
        }
    }
    final XTBoundaryDefinitions boundaryDefinitions = serviceTemplate.getBoundaryDefinitions();
    if (boundaryDefinitions != null) {
        boundaryDefinitions.accept(this);
    }
}
Also used : XTTag(org.eclipse.winery.model.tosca.xml.XTTag) XTPlan(org.eclipse.winery.model.tosca.xml.XTPlan) XTBoundaryDefinitions(org.eclipse.winery.model.tosca.xml.XTBoundaryDefinitions) XTTopologyTemplate(org.eclipse.winery.model.tosca.xml.XTTopologyTemplate)

Aggregations

XTPlan (org.eclipse.winery.model.tosca.xml.XTPlan)2 TExportedOperation (org.eclipse.winery.model.tosca.TExportedOperation)1 TPlan (org.eclipse.winery.model.tosca.TPlan)1 XTBoundaryDefinitions (org.eclipse.winery.model.tosca.xml.XTBoundaryDefinitions)1 XTExportedOperation (org.eclipse.winery.model.tosca.xml.XTExportedOperation)1 XTTag (org.eclipse.winery.model.tosca.xml.XTTag)1 XTTopologyTemplate (org.eclipse.winery.model.tosca.xml.XTTopologyTemplate)1