当前位置: 首页>>代码示例>>Java>>正文


Java Properties.getProperty方法代码示例

本文整理汇总了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);
                    }
                }
            }
        }
  };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:NetBeansRunParamsIDEChecker.java

示例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]);
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:41,代码来源:AddOnOptionsPanel.java

示例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;
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:8,代码来源:POMUtils.java


注:本文中的org.netbeans.modules.maven.model.pom.Properties.getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。