org.apache.tamaya.resolver.internal

## Class ResourceResolver

- java.lang.Object
- - org.apache.tamaya.resolver.internal.ResourceResolver

- All Implemented Interfaces:
    ExpressionResolver

      @Priority(value=300)
      public final class ResourceResolver
      extends Object
      implements ExpressionResolver

  Property resolver implementation that tries to load the given resource from the current classpath using the Thread Context classloader, and as fallback from the classloader that loaded this module and system classloader. It can be explicitly addressed by prefixing `resource:`, e.g. `${resource:META-INF/VERSION}`.

  If the `Resources` module is available this module is used for resolving the expression.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceResolver()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `evaluate(String expression)` Evaluates the given expression.
    `String` | `getResolverPrefix()` Get the unique resolver prefix.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceResolver

          public ResourceResolver()

  - ### Method Detail

    - #### getResolverPrefix

          public String getResolverPrefix()

      Description copied from interface: `ExpressionResolver`
      Get the unique resolver prefix. This allows to address a resolver explicitly, in case of conflicts. By default all registered resolvers are called in order as defined by the `Priority` annotation.
      Specified by:
        `getResolverPrefix` in interface `ExpressionResolver`
      Returns:
        the prefix that identifies this resolver instance, e.g. 'config:'. The ':' hereby is not required as a separator, but it is recommended to use it, because it fits well, with the other existing resolvers and is easy to read.

    - #### evaluate

          public String evaluate(String expression)

      Description copied from interface: `ExpressionResolver`
      Evaluates the given expression.
      Specified by:
        `evaluate` in interface `ExpressionResolver`
      Parameters:
        `expression` - the expression to be evaluated, not null. If a resolver was addressed explicitly, the prefix is removed prior to calling this method.
      Returns:
        the evaluated expression, or null, if the evaluator is not able to resolve the expression.

Copyright © 2014–2016 Apache Software Foundation. All rights reserved.