org.apache.myfaces.orchestra.dynaForm.uri
Class UriResolver

java.lang.Object
  extended by org.apache.myfaces.orchestra.dynaForm.uri.UriResolver
Direct Known Subclasses:
FacesUriResolver

public abstract class UriResolver
extends Object

Resolves the URI to a configuration


Nested Class Summary
static class UriResolver.Configuration
          The configuration
 
Constructor Summary
UriResolver()
           
 
Method Summary
protected  UriResolver.Configuration createConfiguration(Extractor extractor, String entity)
           
protected  InputStream findConfig(String config)
          load the configuration
protected  String getRequiredProperty(String config, Properties props, String key)
           
protected  InputStream getResourceAsStream(String resource)
           
protected  UriResolver.Configuration resolve(String scheme, String path)
          Look in all META-INF directories in the classpath for a file of name "dynaForm-scheme.xml", where scheme is a parameter to this method.
 UriResolver.Configuration resolveUri(String uri)
          resolve the given uri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriResolver

public UriResolver()
Method Detail

createConfiguration

protected UriResolver.Configuration createConfiguration(Extractor extractor,
                                                        String entity)

resolveUri

public UriResolver.Configuration resolveUri(String uri)
resolve the given uri


resolve

protected UriResolver.Configuration resolve(String scheme,
                                            String path)
Look in all META-INF directories in the classpath for a file of name "dynaForm-scheme.xml", where scheme is a parameter to this method.

From that file, load a Properties object and get the value of key "Extractor", which is expected to be the name of a class that implements the Extractor interface.

Use the Extractor instance to return a simple (extractor, classname) pairing. TODO: use the normal java Service configuration approach instead.


findConfig

protected InputStream findConfig(String config)
load the configuration


getResourceAsStream

protected InputStream getResourceAsStream(String resource)

getRequiredProperty

protected String getRequiredProperty(String config,
                                     Properties props,
                                     String key)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.