com.sun.jersey.server.impl.template
Class TemplateFactory

java.lang.Object
  extended by com.sun.jersey.server.impl.template.TemplateFactory
All Implemented Interfaces:
TemplateContext

public final class TemplateFactory
extends java.lang.Object
implements TemplateContext

Author:
Paul.Sandoz@Sun.Com

Constructor Summary
TemplateFactory(ProviderServices providerServices)
           
 
Method Summary
 ResolvedViewable resolveViewable(Viewable v)
          Resolve a Viewable.
 ResolvedViewable resolveViewable(Viewable v, java.lang.Class<?> resolvingClass)
          Resolve a Viewable given a resolving class.
 ResolvedViewable resolveViewable(Viewable v, javax.ws.rs.core.UriInfo ui)
          Resolve a Viewable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateFactory

public TemplateFactory(ProviderServices providerServices)
Method Detail

resolveViewable

public ResolvedViewable resolveViewable(Viewable v)
Description copied from interface: TemplateContext
Resolve a Viewable.

If the template name of the viewable is not absolute then the resolving class of the viewable is utilized to resolve the relative template name into an absolute template name. If the resolving class is not set (a null value) then the class of the model is utilized as the resolving class. If the model is not set (a null value) then a TemplateContextException is thrown.

Specified by:
resolveViewable in interface TemplateContext
Parameters:
v - the viewable
Returns:
the resolved viewable

resolveViewable

public ResolvedViewable resolveViewable(Viewable v,
                                        javax.ws.rs.core.UriInfo ui)
Description copied from interface: TemplateContext
Resolve a Viewable.

If the template name of the viewable is not absolute then the resolving class of the viewable is utilized to resolve the relative template name into an absolute template name. If the resolving class is not set (a null value) then the class of the last matching resource obtained from UriInfo.getMatchedResources(), namely the class obtained from the expression uriInfo.getMatchedResources().get(0).getClass(), is utilized as the resolving class. If there are no matching resoruces then a TemplateContextException is thrown.

Specified by:
resolveViewable in interface TemplateContext
Parameters:
v - the viewable
Returns:
the resolved viewable

resolveViewable

public ResolvedViewable resolveViewable(Viewable v,
                                        java.lang.Class<?> resolvingClass)
Description copied from interface: TemplateContext
Resolve a Viewable given a resolving class.

If the template name of the viewable is not absolute then the resolving class of the viewable is utilized to resolve the relative template name into an absolute template name. If the resolving class is not set (a null value) then the class of the resolvingClass parameter is utilized as the resolving class. If the resolvingClass parameter is null then a TemplateContextException is thrown.

Specified by:
resolveViewable in interface TemplateContext
Parameters:
v - the viewable.
resolvingClass - the resolving class to use if the resolving class of the viewable is not set.
Returns:
the resolved viewable.


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.