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


Java ExpressionEvaluationException类代码示例

本文整理汇总了Java中org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException的典型用法代码示例。如果您正苦于以下问题:Java ExpressionEvaluationException类的具体用法?Java ExpressionEvaluationException怎么用?Java ExpressionEvaluationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: resolveProjectLocation

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
@Override
public FileObject resolveProjectLocation(String path) {
    if ("".equals(path)) {
        return null;
    }
    try {
        String eval = PluginPropertyUtils.createEvaluator(project).evaluate(path).toString();
        FileObject toRet = FileUtil.toFileObject(FileUtilities.resolveFilePath(handle.getProject().getBasedir(), eval));
        if (toRet != null && toRet.isFolder()) {
            toRet = null;
        }
        return toRet;
    } catch (ExpressionEvaluationException ex) {
        Exceptions.printStackTrace(ex);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:LicenseHeaderPanelProvider.java

示例2: detectUnmanagedModules

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private void detectUnmanagedModules(EnforcerRuleHelper helper, MavenProject project) throws ExpressionEvaluationException, EnforcerRuleException {
    Log log = helper.getLog();
    MavenSession session = RuleHelper.getSession(helper);
    List<MavenProject> projects = session.getProjects();
    ImmutableListMultimap managedDependencies = RuleHelper.getManagedDependenciesAsMap(project);

    for (MavenProject mavenProject : projects) {
        if (ruleIsDefinedInProjectOrNotModuleParent(mavenProject, log)) {
            continue;
        }
        String projectIdentifier = RuleHelper.getProjectIdentifier(mavenProject);
        if (!managedDependencies.containsKey(projectIdentifier)) {
            logHeader(log, "manage all modules");
            log.warn("unmanaged project found: " + projectIdentifier);
            failureDetected = true;
        }
    }

    if (failureDetected) {
        throw new EnforcerRuleException("Failing because of unmanaged projects");
    }
}
 
开发者ID:1and1,项目名称:ono-extra-enforcer-rules,代码行数:23,代码来源:ManageAllModulesRule.java

示例3: addProjectDependenciesToClassRealm

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm realm)
        throws ComponentConfigurationException {
    List<String> runtimeClasspathElements;
    try {
        // noinspection unchecked
        runtimeClasspathElements = (List<String>) expressionEvaluator
                .evaluate("${project.runtimeClasspathElements}");
    } catch (ExpressionEvaluationException e) {
        throw new ComponentConfigurationException(
                "There was a problem evaluating: ${project.runtimeClasspathElements}", e);
    }

    // Add the project dependencies to the ClassRealm
    final URL[] urls = buildUrls(runtimeClasspathElements);
    for (URL url : urls) {
        realm.addURL(url);
    }
}
 
开发者ID:protostuff,项目名称:protostuff-compiler,代码行数:19,代码来源:IncludeProjectDependenciesComponentConfigurator.java

示例4: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    Log log = helper.getLog();

    List<Pattern> excludedPatterns = new ArrayList<Pattern>(excludes.size());
    for (String exclude : excludes) {
        excludedPatterns.add(Pattern.compile(exclude));
    }

    try {
        MavenProject project = (MavenProject) helper.evaluate("${project}");
        List<Artifact> artifactList = project.getAttachedArtifacts();
        for (Artifact artifact : artifactList) {
            String artifactFileName = artifact.getFile().getName();
            log.debug("evaluating artifact [" + artifactFileName + "]");
            for (Pattern pattern : excludedPatterns) {
                if (pattern.matcher(artifactFileName).matches()) {
                    throw new EnforcerRuleException("found banned attached artifact: artifact [" + artifactFileName + "] matched exclude pattern [" + pattern.toString() + "]");
                }
            }
        }

    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup expression", e);
    }

}
 
开发者ID:elastic,项目名称:attached-artifact-enforcer,代码行数:27,代码来源:BannedAttachedArtifacts.java

示例5: addProjectDependenciesToClassRealm

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm)
    throws ComponentConfigurationException
{
  Set<String> runtimeClasspathElements = new HashSet<String>();
  try
  {
    runtimeClasspathElements.addAll((List<String>) expressionEvaluator
        .evaluate("${project.runtimeClasspathElements}"));
    
  }
  catch (ExpressionEvaluationException e)
  {
    throw new ComponentConfigurationException("There was a problem evaluating: ${project.runtimeClasspathElements}",
        e);
  }
  
  Collection<URL> urls = buildURLs(runtimeClasspathElements);
  urls.addAll(buildAritfactDependencies(expressionEvaluator));
  for (URL url : urls)
  {
    // containerRealm.addConstituent(url);
    containerRealm.addURL(url);
  }
}
 
开发者ID:iisi-nj,项目名称:GemFireLite,代码行数:26,代码来源:DomainMojoConfigurator.java

示例6: buildAritfactDependencies

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private Collection<URL> buildAritfactDependencies(ExpressionEvaluator expressionEvaluator)
    throws ComponentConfigurationException
{
  MavenProject project;
  try
  {
    project = (MavenProject) expressionEvaluator.evaluate("${project}");
  }
  catch (ExpressionEvaluationException e1)
  {
    throw new ComponentConfigurationException("There was a problem evaluating: ${project}", e1);
  }
  Collection<URL> urls = new ArrayList<URL>();
  for (Object a : project.getArtifacts())
  {
    try
    {
      urls.add(((Artifact) a).getFile().toURI().toURL());
    }
    catch (MalformedURLException e)
    {
      throw new ComponentConfigurationException("Unable to resolve artifact dependency: " + a, e);
    }
  }
  return urls;
}
 
开发者ID:iisi-nj,项目名称:GemFireLite,代码行数:27,代码来源:DomainMojoConfigurator.java

示例7: addProjectDependenciesToClassRealm

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm) throws ComponentConfigurationException {
    Set<String> runtimeClasspathElements = new HashSet<String>();
    try {
        runtimeClasspathElements.addAll((List<String>) expressionEvaluator.evaluate("${project.runtimeClasspathElements}"));

    } catch (ExpressionEvaluationException e) {
        throw new ComponentConfigurationException("There was a problem evaluating: ${project.runtimeClasspathElements}", e);
    }

    Collection<URL> urls = this.buildURLs(runtimeClasspathElements);
    urls.addAll(this.buildAritfactDependencies(expressionEvaluator));
    for (URL url : urls) {
        containerRealm.addConstituent(url);
    }
}
 
开发者ID:EricssonResearch,项目名称:trap,代码行数:17,代码来源:IndexConfigurator.java

示例8: buildAritfactDependencies

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private Collection<URL> buildAritfactDependencies(ExpressionEvaluator expressionEvaluator) throws ComponentConfigurationException {
    MavenProject project;
    try {
        project = (MavenProject) expressionEvaluator.evaluate("${project}");
    } catch (ExpressionEvaluationException e1) {
        throw new ComponentConfigurationException("There was a problem evaluating: ${project}", e1);
    }
    Collection<URL> urls = new ArrayList<URL>();
    for (Object a : project.getArtifacts()) {
        try {
            urls.add(((Artifact) a).getFile().toURI().toURL());
        } catch (MalformedURLException e) {
            throw new ComponentConfigurationException("Unable to resolve artifact dependency: " + a, e);
        }
    }
    return urls;
}
 
开发者ID:EricssonResearch,项目名称:trap,代码行数:18,代码来源:IndexConfigurator.java

示例9: execute

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
    Log log = helper.getLog();

    try {
        // get the various expressions out of the helper.
        MavenProject project = (MavenProject) helper.evaluate("${project}");
        // MavenSession session = (MavenSession) helper.evaluate("${session}");
        // String target = (String) helper.evaluate("${project.build.directory}");
        // String artifactId = (String) helper.evaluate("${project.artifactId}");

        // ArtifactResolver resolver = (ArtifactResolver) helper.getComponent(ArtifactResolver.class);
        // RuntimeInfo rti = (RuntimeInfo) helper.getComponent(RuntimeInfo.class);
        List compileSourceRoots = project.getCompileSourceRoots();

        for (Object compileSourceRoot : compileSourceRoots) {
            String path = (String) compileSourceRoot;
            applyForJavaSourcesInRoot(path, log);
        }
    } catch (ExpressionEvaluationException e) {
        throw new EnforcerRuleException("Unable to lookup an expression " + e.getLocalizedMessage(), e);
    }
}
 
开发者ID:CloudSlang,项目名称:cloud-slang,代码行数:23,代码来源:SpringCleansingRule.java

示例10: addProjectDependenciesToClassRealm

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm)
        throws ComponentConfigurationException
{
    List<String> runtimeClasspathElements;
    try
    {
        // noinspection unchecked
        runtimeClasspathElements = (List<String>) expressionEvaluator
                .evaluate("${project.runtimeClasspathElements}");
    }
    catch (ExpressionEvaluationException e)
    {
        throw new ComponentConfigurationException(
                "There was a problem evaluating: ${project.runtimeClasspathElements}", e);
    }

    // Add the project dependencies to the ClassRealm
    final URL[] urls = buildURLs(runtimeClasspathElements);
    for (URL url : urls)
    {
        containerRealm.addConstituent(url);
    }
}
 
开发者ID:protostuff,项目名称:protostuff,代码行数:24,代码来源:IncludeProjectDependenciesComponentConfigurator.java

示例11: evaluate

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
public Object evaluate( String expression, Class<?> type )
    throws ExpressionEvaluationException
{
    if ( preprocessor != null )
    {
        try
        {
            return preprocessor.preprocessValue( expression, type );
        }
        catch ( BeanConfigurationException e )
        {
            throw new ExpressionEvaluationException( e.getMessage(), e );
        }
    }
    return expression;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:17,代码来源:DefaultBeanConfigurator.java

示例12: handlePropertyEditorFields

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private void handlePropertyEditorFields(Object mojo,
		List<PropertyEditorField> editorSupportFields,
		ExpressionEvaluator expressionEvaluator) {
	for (PropertyEditorField propertyEditorField : editorSupportFields) {
		PropertyEditorComponent<?> propertyEditorComponent = propertyEditorLookup
				.getPropertyEditorComponent(propertyEditorField);
		String propertyName = propertyEditorField.getProperty();
		Object propValue;
		try {
			propValue = expressionEvaluator.evaluate("${" + propertyName
					+ "}");
			if (propValue == null) {
				continue;
			}
			String propertyValueString = null;
			propertyValueString = propValue.toString();
			propertyEditorField.setValue(propertyEditorComponent,
					propertyValueString);
		} catch (ExpressionEvaluationException e) {
			throw new IllegalStateException("Unable to inject "
					+ propertyEditorField + " with property named "
					+ propertyName, e);
		}
	}
}
 
开发者ID:link-intersystems,项目名称:maven,代码行数:26,代码来源:PropertyEditorSupportConverter.java

示例13: addProjectDependenciesToClassRealm

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
private void addProjectDependenciesToClassRealm(ExpressionEvaluator expressionEvaluator, ClassRealm containerRealm)
		throws ComponentConfigurationException {
	List<String> runtimeClasspathElements;
	try {
		// noinspection unchecked
		runtimeClasspathElements = (List<String>) expressionEvaluator
				.evaluate("${project.runtimeClasspathElements}");
	} catch (ExpressionEvaluationException e) {
		throw new ComponentConfigurationException(
				"There was a problem evaluating: ${project.runtimeClasspathElements}", e);
	}

	// Add the project dependencies to the ClassRealm
	final URL[] urls = buildURLs(runtimeClasspathElements);
	for (URL url : urls) {
		containerRealm.addConstituent(url);
	}
}
 
开发者ID:raphaeljolivet,项目名称:java2typescript,代码行数:19,代码来源:IncludeProjectDependenciesComponentConfigurator.java

示例14: gatherArtifacts

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
@Override
protected void gatherArtifacts() {
    try {
        List<MavenProject> reactorProjects = (List<MavenProject>)helper.evaluate("${reactorProjects}");
        for (MavenProject rp: reactorProjects){
            for (Object item : rp.getArtifacts()){
                if (item != null && item instanceof Artifact){
                    Artifact artifact = (Artifact) item;
                    artifacts.add(artifact);
                    helper.getLog().debug("[victims-enforcer] adding reactor dependency " + artifact.toString());
                }
            }
        }
    } catch (ExpressionEvaluationException ex) {
        helper.getLog().debug(ex);
        helper.getLog().info("[victims-enforcer] unable to find dependencies using: 'ReactorCollector'");
    }
}
 
开发者ID:victims,项目名称:victims-enforcer-legacy,代码行数:19,代码来源:ArtifactCollector.java

示例15: sequenceStart

import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; //导入依赖的package包/类
public @Override void sequenceStart(String sequenceId, OutputVisitor visitor) {
       session = null;
// Fix for #257563 / SUREFIRE-1158, where surefire 2.19.x
// removed the printing of the output directory. Get the directory from
// the configuration directly or fallback to the plugin standard
if (usingSurefire219(this.config.getMavenProject())) {
    // http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#reportsDirectory
    String reportsDirectory = PluginPropertyUtils.getPluginProperty(config.getMavenProject(),
	    Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_SUREFIRE, "reportsDirectory", "test", null); // NOI18N
    if (null == reportsDirectory) {
	// fallback to default value
	try {
	    Object defaultValue = PluginPropertyUtils.createEvaluator(config.getMavenProject())
		    .evaluate("${project.build.directory}/surefire-reports");
	    if (defaultValue instanceof String) {
		reportsDirectory = (String) defaultValue;
	    }
	} catch (ExpressionEvaluationException ex) {
	    // NOP could not resolved default value
	}
    }
    if (null != reportsDirectory) {
	File absoluteFile = new File(reportsDirectory);
	// configuration might be "target/directory", which is relative
	// to the maven project or an absolute path
	File relativeFile = new File(this.config.getMavenProject().getBasedir(), reportsDirectory);
	if (absoluteFile.exists() && absoluteFile.isDirectory()) {
	    outputDir = absoluteFile;
	} else {
	    if (relativeFile.exists() && relativeFile.isDirectory()) {
		outputDir = relativeFile;
	    }
	}
	if (null != outputDir) {
	    createSession(outputDir);
	}
    }
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:JUnitOutputListenerProvider.java


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