本文整理汇总了Java中org.netbeans.modules.maven.model.pom.Properties.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Properties.getProperty方法的具体用法?Java Properties.getProperty怎么用?Java Properties.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.modules.maven.model.pom.Properties
的用法示例。
在下文中一共展示了Properties.getProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRemoveIdePropertyOperation
import org.netbeans.modules.maven.model.pom.Properties; //导入方法依赖的package包/类
private static ModelOperation<POMModel> createRemoveIdePropertyOperation() {
return new ModelOperation<POMModel>() {
public @Override void performOperation(POMModel model) {
Project project = model.getProject();
Properties properties = project.getProperties();
if (properties != null) {
if (properties.getProperty(OLD_PROPERTY) != null) {
properties.setProperty(OLD_PROPERTY, null);
}
String args = properties.getProperty(MASTER_PROPERTY);
if (args != null) {
String ref = "${" + OLD_PROPERTY + "}"; // NOI18N
if (args.contains(ref)) {
args = args.replace(ref, "");
if (args.trim().length() == 0) {
args = null;
}
properties.setProperty(MASTER_PROPERTY, args);
}
}
}
}
};
}
示例2: readOptions
import org.netbeans.modules.maven.model.pom.Properties; //导入方法依赖的package包/类
private void readOptions( Lookup context ) {
Project project = context.lookup(Project.class);
NbMavenProject mvnProject =
project.getLookup().lookup(NbMavenProject.class);
MavenProject mavenProject = mvnProject.getMavenProject();
File file = mavenProject.getFile();
FileObject pom = FileUtil.toFileObject(FileUtil.normalizeFile(file));
final String[] version = new String[1];
final String[] title = new String[1];
final String[] vendor = new String[1];
final String[] widgetset = new String[1];
ModelOperation<POMModel> operation = new ModelOperation<POMModel>() {
@Override
public void performOperation( POMModel model ) {
Properties properties = model.getProject().getProperties();
if (properties != null) {
version[0] = properties.getProperty(IMPLEMENTATION_VERSION);
title[0] = properties.getProperty(IMPLEMENTATION_TITLE);
vendor[0] = properties.getProperty(IMPLEMENTATION_VENDOR);
}
POMExtensibilityElement widgetsets =
POMUtils.getWidgetsets(model);
if (widgetsets != null) {
widgetset[0] = widgetsets.getElementText();
if (widgetset[0] != null) {
widgetset[0] = widgetset[0].trim();
}
}
}
};
Utilities.performPOMModelOperations(pom,
Collections.singletonList(operation));
myImplTitle.setText(title[0]);
myImplVersion.setText(version[0]);
myImplVendor.setText(vendor[0]);
myWidgetset.setText(widgetset[0]);
}
示例3: getVaadinVersion
import org.netbeans.modules.maven.model.pom.Properties; //导入方法依赖的package包/类
public static String getVaadinVersion( POMModel model ) {
Properties properties = model.getProject().getProperties();
if (properties != null) {
return properties.getProperty(VAADIN_PLUGIN_VERSION);
}
return null;
}