ValueSource modelValueSource2 = new ObjectBasedValueSource( model );
/** * Split the expression into parts, tokenized on the dot ('.') character. Then, * starting at the root object contained in this value source, apply each part * to the object graph below this root, using either 'getXXX()' or 'isXXX()' * accessor types to resolve the value for each successive expression part. * Finally, return the result of the last expression part's resolution. * <br/> * <b>NOTE:</b> The object-graph nagivation actually takes place via the * {@link ReflectionValueExtractor} class. */ public Object getValue( String expression ) { try { return ReflectionValueExtractor.evaluate( expression, root, false ); } catch ( Exception e ) { addFeedback( "Failed to extract \'" + expression + "\' from: " + root, e ); } return null; }
ValueSource modelValueSource2 = new ObjectBasedValueSource( model );
ValueSource modelValueSource2 = new ObjectBasedValueSource( model ); if ( config.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 )
/** * Wrap the specified root object, allowing the specified list of expression * prefixes and setting whether the {@link PrefixedValueSourceWrapper} allows * unprefixed expressions. */ public PrefixedObjectValueSource( List possiblePrefixes, Object root, boolean allowUnprefixedExpressions ) { super( new PrefixedValueSourceWrapper( new ObjectBasedValueSource( root ), possiblePrefixes, allowUnprefixedExpressions ) ); }
/** * Wrap the specified root object, allowing the specified expression prefix. */ public PrefixedObjectValueSource( String prefix, Object root ) { super( new PrefixedValueSourceWrapper( new ObjectBasedValueSource( root ), prefix ) ); }
valueSources.add( new ObjectBasedValueSource( project ) ); valueSources.add( new MapBasedValueSource( project.getProperties() ) ); valueSources.add( new MapBasedValueSource( System.getProperties() ) );
interpolator.addValueSource( new ObjectBasedValueSource( aProject ) );
ValueSource modelValueSource2 = new ObjectBasedValueSource(model); if (config.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0) { modelValueSource2 = new ProblemDetectingValueSource(modelValueSource2, "", "project.", problems);
ValueSource modelValueSource2 = new ObjectBasedValueSource( model ); if ( config.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 )
public static String interpolate( String value, Model model ) throws ReleaseExecutionException { if ( value != null && value.contains( "${" ) ) { StringSearchInterpolator interpolator = new StringSearchInterpolator(); List<String> pomPrefixes = Arrays.asList( "pom.", "project." ); interpolator.addValueSource( new PrefixedObjectValueSource( pomPrefixes, model, false ) ); interpolator.addValueSource( new MapBasedValueSource( model.getProperties() ) ); interpolator.addValueSource( new ObjectBasedValueSource( model ) ); try { value = interpolator.interpolate( value, new PrefixAwareRecursionInterceptor( pomPrefixes ) ); } catch ( InterpolationException e ) { throw new ReleaseExecutionException( "Failed to interpolate " + value + " for project " + model.getId(), e ); } } return value; } }
interpolator.addValueSource( new ObjectBasedValueSource( aProject ) ); interpolator.addValueSource( new MapBasedValueSource( aProject.getProperties() ) );