org.codehaus.enunciate.modules.php
Class PrefixMethod

java.lang.Object
  extended by org.codehaus.enunciate.modules.php.PrefixMethod
All Implemented Interfaces:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateModel

public class PrefixMethod
extends Object
implements freemarker.template.TemplateMethodModel

A method used in templates to output the prefix for a given namespace.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Constructor Summary
PrefixMethod()
           
 
Method Summary
 Object exec(List list)
          Returns the qname of the element that has the first parameter as the namespace, the second as the element.
protected static EnunciateFreemarkerModel getModel()
          Get the current root model.
protected static Map<String,String> getNamespacesToPrefixes()
          The namespace to prefix map.
protected  String lookupPrefix(String namespace)
          Convenience method to lookup a namespace prefix given a namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixMethod

public PrefixMethod()
Method Detail

exec

public Object exec(List list)
            throws freemarker.template.TemplateModelException
Returns the qname of the element that has the first parameter as the namespace, the second as the element.

Specified by:
exec in interface freemarker.template.TemplateMethodModel
Parameters:
list - The arguments.
Returns:
The qname.
Throws:
freemarker.template.TemplateModelException

lookupPrefix

protected String lookupPrefix(String namespace)
Convenience method to lookup a namespace prefix given a namespace.

Parameters:
namespace - The namespace for which to lookup the prefix.
Returns:
The namespace prefix.

getNamespacesToPrefixes

protected static Map<String,String> getNamespacesToPrefixes()
The namespace to prefix map.

Returns:
The namespace to prefix map.

getModel

protected static EnunciateFreemarkerModel getModel()
Get the current root model.

Returns:
The current root model.


Copyright © 2015. All rights reserved.