當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。