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


Java Xpp3Dom.getValue方法代码示例

本文整理汇总了Java中org.codehaus.plexus.util.xml.Xpp3Dom.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Xpp3Dom.getValue方法的具体用法?Java Xpp3Dom.getValue怎么用?Java Xpp3Dom.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.codehaus.plexus.util.xml.Xpp3Dom的用法示例。


在下文中一共展示了Xpp3Dom.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: simpleProperty

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
static @NonNull ConfigurationBuilder<String> simpleProperty(final @NonNull String property) {
    return new ConfigurationBuilder<String>() {

        @Override
        public String build(Xpp3Dom configRoot, ExpressionEvaluator eval) {
            if (configRoot != null) {
                Xpp3Dom source = configRoot.getChild(property);
                if (source != null) {
                    String value = source.getValue();
                    if (value == null) {
                        return null;
                    }
                    return value.trim();
                }
            }
            return null;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:PluginPropertyUtils.java

示例2: listProperty

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
static @NonNull ConfigurationBuilder<String[]> listProperty(final @NonNull String multiProperty, final @NonNull String singleProperty) {
    return new ConfigurationBuilder<String[]>() {
        @Override
        public String[] build(Xpp3Dom conf, ExpressionEvaluator eval) {
            if (conf != null) {
                Xpp3Dom dom = (Xpp3Dom) conf; // MNG-4862
                Xpp3Dom source = dom.getChild(multiProperty);
                if (source != null) {
                    List<String> toRet = new ArrayList<String>();
                    Xpp3Dom[] childs = source.getChildren(singleProperty);
                    for (Xpp3Dom ch : childs) {
                        String chvalue = ch.getValue() == null ? "" : ch.getValue().trim();  //NOI18N
                        toRet.add(chvalue);  //NOI18N
                    }
                    return toRet.toArray(new String[toRet.size()]);
                }
            }
            return null;
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:PluginPropertyUtils.java

示例3: getValueFromServerConfiguration

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Get string value from server configuration section in settings.xml.
 *
 * @param server Server object.
 * @param key    Key string.
 * @return String value if key exists; otherwise, return null.
 */
public static String getValueFromServerConfiguration(final Server server, final String key) {
    if (server == null) {
        return null;
    }

    final Xpp3Dom configuration = (Xpp3Dom) server.getConfiguration();
    if (configuration == null) {
        return null;
    }

    final Xpp3Dom node = configuration.getChild(key);
    if (node == null) {
        return null;
    }

    return node.getValue();
}
 
开发者ID:Microsoft,项目名称:azure-maven-plugins,代码行数:25,代码来源:Utils.java

示例4: getCompileTargetVersion

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Determines the Java compiler target version by inspecting the project's maven-compiler-plugin
 * configuration.
 *
 * @return The Java compiler target version.
 */
public String getCompileTargetVersion() {
  // maven-plugin-compiler default is 1.5
  String javaVersion = "1.5";
  if (mavenProject != null) {
    // check the maven.compiler.target property first
    String mavenCompilerTargetProperty = mavenProject.getProperties()
        .getProperty("maven.compiler.target");
    if (mavenCompilerTargetProperty != null) {
      javaVersion = mavenCompilerTargetProperty;
    } else {
      Plugin compilerPlugin = mavenProject
          .getPlugin("org.apache.maven.plugins:maven-compiler-plugin");
      if (compilerPlugin != null) {
        Xpp3Dom config = (Xpp3Dom) compilerPlugin.getConfiguration();
        if (config != null) {
          Xpp3Dom domVersion = config.getChild("target");
          if (domVersion != null) {
            javaVersion = domVersion.getValue();
          }
        }
      }
    }
  }
  return javaVersion;
}
 
开发者ID:GoogleCloudPlatform,项目名称:app-maven-plugin,代码行数:32,代码来源:CloudSdkMojo.java

示例5: addExcludedGroups

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private Xpp3Dom addExcludedGroups(Xpp3Dom configNode) {
    for (Xpp3Dom config : configNode.getChildren()) {
        if ("excludedGroups".equals(config.getName())) {
            Logger.getGlobal().log(Level.INFO, "Adding excluded groups to existing ones");
            String current = config.getValue();
            // Should not add duplicate entry for NonDexIgnore
            if (current.contains("edu.illinois.NonDexIgnore")) {
                return configNode;
            }
            current = "," + current;
            // It seems there is an error if you have the variable
            // in the excludedGroups string concatenated (in any
            // position) to the concrete class we are adding to
            // the excludedGroups
            // ${excludedGroups} appears when
            // there is no excludedGroups specified in the pom
            // and potentially in other situations
            current = current.replace(",${excludedGroups}", "");
            config.setValue("edu.illinois.NonDexIgnore" + current);
            return configNode;
        }
    }
    Logger.getGlobal().log(Level.INFO, "Adding excluded groups to newly created one");
    configNode.addChild(this.makeNode("excludedGroups", "edu.illinois.NonDexIgnore"));
    return configNode;
}
 
开发者ID:TestingResearchIllinois,项目名称:NonDex,代码行数:27,代码来源:NonDexSurefireExecution.java

示例6: resolveFromRootThenParent

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private String resolveFromRootThenParent(Xpp3Dom pluginPomDom, String element) throws Exception {
    Xpp3Dom elementDom = pluginPomDom.getChild(element);
    if (elementDom == null) {
        Xpp3Dom pluginParentDom = pluginPomDom.getChild("parent");
        if (pluginParentDom != null) {
            elementDom = pluginParentDom.getChild(element);
            if (elementDom == null) {
                throw new Exception("unable to determine " + element);
            } else {
                return elementDom.getValue();
            }
        } else {
            throw new Exception("unable to determine " + element);
        }
    } else {
        return elementDom.getValue();
    }
}
 
开发者ID:holidaycheck,项目名称:marathon-maven-plugin,代码行数:19,代码来源:AbstractMarathonMojoTestWithJUnit4.java

示例7: getWarSrcDir

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Returns the war source directory such as src/main/webapp
 *
 * @param mavenProject
 *
 * @param config
 *          gwt-maven-maven config DOM
 * @return the {@link #WAR_SRC_DIR_PROPERTY_KEY} value from the config if it exists, {@link #WAR_SRC_DIR_DEFAULT}
 *         otherwise or if config is null
 */
private static final IPath getWarSrcDir(MavenProject mavenProject, Xpp3Dom config) {
  String spath = WAR_SRC_DIR_DEFAULT;

  if (config != null) {
    for (Xpp3Dom child : config.getChildren()) {
      if (child != null && WAR_SRC_DIR_PROPERTY_KEY.equals(child.getName())) {
        spath = child.getValue() == null ? WAR_SRC_DIR_DEFAULT : child.getValue().trim();
      }
    }
  }

  IPath path = null;
  if (spath != null) {
    path = new Path(spath);

    String basePath = mavenProject.getBasedir().toPath().toAbsolutePath().toString();
    String fullPath = basePath + "/" + spath;
    java.io.File fullPathFile = new java.io.File(fullPath);
    if (!fullPathFile.exists()) {
      path = null;
    }
  }

  return path;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:36,代码来源:MavenProjectConfigurator.java

示例8: getOutputDir

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private File getOutputDir() {
    File outputDir = new File(project.getBasedir(), "res");

    List<Plugin> plugins =  project.getBuildPlugins();
    for (Plugin plugin : plugins) {
        if (plugin.getGroupId().equals("com.jayway.maven.plugins.android.generation2") && plugin.getArtifactId().equals("android-maven-plugin")) {
            Xpp3Dom dom = (Xpp3Dom) plugin.getConfiguration();
            Xpp3Dom resDir = dom.getChild("resourceDirectory");
            if (resDir != null) {
                outputDir = new File(resDir.getValue());
            }
        }
    }

    return outputDir;
}
 
开发者ID:willowtreeapps,项目名称:saguaro,代码行数:17,代码来源:SaguaroMojo.java

示例9: getServiceUnitName

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
protected String getServiceUnitName(MavenProject project) {
	for (Object elem : project.getBuildPlugins()) {
		if (elem instanceof Plugin) {
			Plugin plugin = (Plugin)elem;
			if (plugin.getGroupId().equals("org.apache.servicemix.tooling")
					&& plugin.getArtifactId().equals("jbi-maven-plugin")) {
				Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
				if (configuration != null) {
					Xpp3Dom serviceUnitName = configuration.getChild("serviceUnitName");
					if (serviceUnitName != null) {
						return serviceUnitName.getValue();
					}
				}
				break;
			}
		}
	}
	return null;
}
 
开发者ID:hitakaken,项目名称:bigfoot-maven-plugins,代码行数:20,代码来源:AbstractJbiMojo.java

示例10: getNativesPath

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
public static String getNativesPath(MavenProject mavenProject)
{
	Object configuration = getNativesPlugin(mavenProject).getConfiguration();
	if (configuration instanceof Xpp3Dom)
	{
		Xpp3Dom confDom = (Xpp3Dom) configuration;
		Xpp3Dom nativesPathConfig = confDom.getChild(nativesPathAttribute);
		if(nativesPathConfig!=null)
		{
			String nativesPathConfigValue = nativesPathConfig.getValue();
			if(nativesPathConfigValue!=null && !nativesPathConfigValue.equals(""))
			{
				return nativesPathConfigValue;
			}
		}
	}
	return defaultNativesPath;
}
 
开发者ID:virtuoushub,项目名称:mavennatives,代码行数:19,代码来源:NativesConfigExtractor.java

示例11: getArtifacts

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
protected static String[] getArtifacts(Xpp3Dom config, String artifactTag) {
    Xpp3Dom oldArtifactsXml = config == null ? null : config.getChild(artifactTag);

    if (oldArtifactsXml == null) {
        return new String[0];
    }

    if (oldArtifactsXml.getChildCount() == 0) {
        String artifact = oldArtifactsXml.getValue();
        return new String[]{artifact};
    } else {
        String[] ret = new String[oldArtifactsXml.getChildCount()];
        for (int i = 0; i < oldArtifactsXml.getChildCount(); ++i) {
            ret[i] = oldArtifactsXml.getChild(i).getValue();
        }

        return ret;
    }
}
 
开发者ID:revapi,项目名称:revapi,代码行数:20,代码来源:ReportAggregateMojo.java

示例12: getJavaVersion

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * @return the java version used the pom (target) and 1.7 if not present.
 */
protected String getJavaVersion() {
  String javaVersion = "1.7";
  Plugin p = maven_project.getPlugin("org.apache.maven.plugins:maven-compiler-plugin");
  if (p != null) {
    Xpp3Dom config = (Xpp3Dom) p.getConfiguration();
    if (config == null) {
      return javaVersion;
    }
    Xpp3Dom domVersion = config.getChild("target");
    if (domVersion != null) {
      javaVersion = domVersion.getValue();
    }
  }
  return javaVersion;
}
 
开发者ID:GoogleCloudPlatform,项目名称:gcloud-maven-plugin,代码行数:19,代码来源:AbstractGcloudMojo.java

示例13: processChildren

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
/**
 * Recursively process the DOM elements to inline any property values from the model.
 * @param userProperties
 * @param model
 * @param parent
 */
private void processChildren( Properties userProperties, Model model, Xpp3Dom parent )
{
    for ( int i = 0; i < parent.getChildCount(); i++ )
    {
        Xpp3Dom child = parent.getChild( i );

        if ( child.getChildCount() > 0 )
        {
            processChildren( userProperties, model, child );
        }
        if ( child.getValue() != null && child.getValue().startsWith( "${" ) )
        {
            String replacement = resolveProperty( userProperties, model.getProperties(), child.getValue() );

            if ( replacement != null && !replacement.isEmpty() )
            {
                logger.debug( "Replacing child value " + child.getValue() + " with " + replacement );
                child.setValue( replacement );
            }
        }

    }
}
 
开发者ID:release-engineering,项目名称:pom-manipulation-ext,代码行数:30,代码来源:ModelIO.java

示例14: parseStrings

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private List<String> parseStrings( Xpp3Dom dom )
{
    List<String> strings = null;

    if ( dom != null )
    {
        strings = new ArrayList<String>();

        for ( Xpp3Dom child : dom.getChildren() )
        {
            String string = child.getValue();
            if ( string != null )
            {
                string = string.trim();
                if ( string.length() > 0 )
                {
                    strings.add( string );
                }
            }
        }
    }

    return strings;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:25,代码来源:ExtensionDescriptorBuilder.java

示例15: getValue

import org.codehaus.plexus.util.xml.Xpp3Dom; //导入方法依赖的package包/类
private static Object getValue( Xpp3Dom node )
{
    if ( node.getValue() != null )
    {
        return node.getValue();
    }
    else
    {
        List<Object> children = new ArrayList<Object>();
        for ( int i = 0; i < node.getChildCount(); i++ )
        {
            children.add( getValue( node.getChild( i ) ) );
        }
        return children;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:Xpp3DomNodePointer.java


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