本文整理汇总了Java中net.ssehub.easy.varModel.model.Project.getVersion方法的典型用法代码示例。如果您正苦于以下问题:Java Project.getVersion方法的具体用法?Java Project.getVersion怎么用?Java Project.getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.ssehub.easy.varModel.model.Project
的用法示例。
在下文中一共展示了Project.getVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerProject
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Registers an empty project with given names and given imports.
*
* @param projectName the name of the project
* @param importNames the imports (may be empty)
*/
private void registerProject(String projectName, String... importNames) {
Project p = new Project(projectName);
List<ModelImport<Project>> imps = null;
if (null != importNames) {
imps = new ArrayList<ModelImport<Project>>();
for (int i = 0; i < importNames.length; i++) {
if (null != importNames[i] && importNames[i].length() > 0) {
ProjectImport imp = new ProjectImport(importNames[i], null);
p.addImport(imp);
imps.add(imp);
}
}
if (imps.isEmpty()) {
imps = null;
}
}
File file = new File(BASE, projectName + ".ivml");
// don't care whether this exists or not
ModelInfo<Project> info = new ModelInfo<Project>(p.getName(), p.getVersion(), this, file.toURI(), imps);
data.put(info, p);
name2Info.put(projectName, info);
}
示例2: marshal
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Marshals a given <code>object</code> to the given <code>writer</code> in the
* specified marshaling <code>context</code>. This method translates a Project
* type singleton to a name.
*
* @param object the object to be marshaled
* @param writer the output stream writer
* @param context the marshaling context
*/
@Override
public void marshal(Object object, HierarchicalStreamWriter writer, MarshallingContext context) {
Project project = (Project) object;
writer.startNode("project");
writer.addAttribute("name", project.getName());
Version version = project.getVersion();
String versionAsString = "";
if (null != version) {
versionAsString = version.getVersion();
}
writer.addAttribute("version", versionAsString);
writer.endNode();
}
示例3: ivmlFileLocation
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* This method locates the project file for the ivml variability model for a specific ivml project
* within the given storage path.
*
* @param project The ivml project which should be read/saved
* @param storagePath The location (top level folder) of the configuration files
* @return The absolute path for the file to be written/read.
*/
public static final String ivmlFileLocation(Project project, String storagePath) {
String projectName = project.getQualifiedName();
String projectVersion = null;
Version version = project.getVersion();
if (null != version) {
projectVersion = version.getVersion();
}
return ivmlFileLocation(projectName, projectVersion, storagePath);
}
示例4: generateQualifiedName
import net.ssehub.easy.varModel.model.Project; //导入方法依赖的package包/类
/**
* Returns the qualified name of a project as unique identifier for comparison whether the project was deleted.
* @param project The project for which the qualified name shall be generated.
* @return projectName[+Version].
*/
private String generateQualifiedName(Project project) {
Version v = project.getVersion();
return (null == v) ? project.getName() : project.getName() + "+" + v.getVersion();
}