net.dpml.util
Interface Resolver

All Known Subinterfaces:
Module, Resource
All Known Implementing Classes:
DefaultModule, DefaultResource, SimpleResolver

public interface Resolver

Interace implemented by a value (key, ref, and property) resolver.

Version:
1.0.0
Author:
The Digital Product Meta Library

Method Summary
 String getProperty(String key)
          Return a property value.
 String getProperty(String key, String value)
          Return a property value.
 String resolve(String value)
          Symbolic expansion of a supplied value.
 URI toURI(String ref)
          Utility function supporting resolution of uris containing 'resource' or 'alias' schemes.
 

Method Detail

toURI

public URI toURI(String ref)
          throws URISyntaxException
Utility function supporting resolution of uris containing 'resource' or 'alias' schemes. If the supplied uri scheme is 'resource' or 'alias' the reference is resolved to a artifact type, group and name from which a resource is resolved and the uri returned. If the scheme is resource the usi of the resource is returned. If the scheme is 'alias' a link alias is returned. If the scheme is not 'resource' or 'alias' the argument will be evaluated as a normal transit artifact uri specification.

Parameters:
ref - the uri argument
Returns:
the uri value
Throws:
URISyntaxException - if an error occurs during uri creation

getProperty

public String getProperty(String key)
Return a property value.

Parameters:
key - the property key
Returns:
the property value

getProperty

public String getProperty(String key,
                          String value)
Return a property value.

Parameters:
key - the property key
value - the default value
Returns:
the property value

resolve

public String resolve(String value)
Symbolic expansion of a supplied value. Replace any occurances of ${[key]} with the value of the property assigned to the [key] in system properties.

Parameters:
value - a string containing possibly multiple ${[value]} sequences
Returns:
the expanded string