org.apache.myfaces.buildtools.maven2.plugin.builder.utils
Class MyfacesUtils

java.lang.Object
  extended by org.apache.myfaces.buildtools.maven2.plugin.builder.utils.MyfacesUtils

public class MyfacesUtils
extends Object

Collection of useful utility methods.

An instance of this type is made available to the templates used to generate output files, so that they can call these useful methods.


Field Summary
static Set PRIMITIVE_TYPES
           
static Set RESERVED_WORDS
           
 
Constructor Summary
MyfacesUtils()
           
 
Method Summary
static String castIfNecessary(String propClass)
           
static String convertClassToSourcePath(String className, String fileExtension)
           
static String convertStringToLiteral(String value)
           
static String convertStringToLiteral(String className, String value)
           
static String fill(String base, int length)
           
static String getBoxedClass(String className)
           
static String getClassFromFullClass(String fullClass)
          Extract the simple class name from a fully-qualified classname.
static String getConstantNameFromProperty(String propertyName)
           
static String getConstantNameFromProperty(String propertyName, String constantSuffix)
           
static String getDefaultValue(PropertyMeta property)
           
static String getDefaultValueField(PropertyMeta property)
           
static String getEventNameFromEventType(String eventFullClass)
           
static String getFullJspPropertyType11(PropertyMeta property)
           
static String getJspPropertyType11(PropertyMeta property)
           
static String getJspPropertyType12(PropertyMeta property)
           
static String getMethodNameFromEvent(String methodPrefix, String eventName, String methodSuffix)
           
static String getMethodReaderFromProperty(String propertyName, String propertyClass)
           
static String getPackageFromFullClass(String fullClass)
           
static String getPrefixedPropertyName(String prefix, String propertyName)
           
static String getPrimitiveType(String className)
           
static String getPropertyClass(PropertyMeta property)
           
static String getSignatureParams(MethodSignatureMeta signature)
           
static String getTagName(String prefixedName)
          Convert h:commandButton to commandButton
static String getTagPrefix(String prefixedName)
           
static String getVariableFromClass(String className)
           
static String getVariableFromName(String name)
           
static String importTagClasses(PropertyHolder component)
           
static String importTagClasses12(ComponentMeta component)
           
static boolean isConverter(String propClass)
           
static boolean isFullClass(String className)
           
static boolean isList(String propClass)
           
static boolean isPrimitiveClass(String className)
           
static boolean isStringMethodBindingReturnType(MethodSignatureMeta sig)
           
static String primitiveDefaultValue(String className)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESERVED_WORDS

public static final Set RESERVED_WORDS

PRIMITIVE_TYPES

public static final Set PRIMITIVE_TYPES
Constructor Detail

MyfacesUtils

public MyfacesUtils()
Method Detail

getPrefixedPropertyName

public static String getPrefixedPropertyName(String prefix,
                                             String propertyName)

getTagName

public static String getTagName(String prefixedName)
Convert h:commandButton to commandButton

Parameters:
prefixedName -
Returns:

getTagPrefix

public static String getTagPrefix(String prefixedName)

getJspPropertyType11

public static String getJspPropertyType11(PropertyMeta property)

getFullJspPropertyType11

public static String getFullJspPropertyType11(PropertyMeta property)

getJspPropertyType12

public static String getJspPropertyType12(PropertyMeta property)

getVariableFromName

public static String getVariableFromName(String name)

importTagClasses

public static String importTagClasses(PropertyHolder component)

importTagClasses12

public static String importTagClasses12(ComponentMeta component)

isConverter

public static boolean isConverter(String propClass)

isList

public static boolean isList(String propClass)

castIfNecessary

public static String castIfNecessary(String propClass)

getBoxedClass

public static String getBoxedClass(String className)

getSignatureParams

public static String getSignatureParams(MethodSignatureMeta signature)

isStringMethodBindingReturnType

public static boolean isStringMethodBindingReturnType(MethodSignatureMeta sig)

getMethodReaderFromProperty

public static String getMethodReaderFromProperty(String propertyName,
                                                 String propertyClass)

getPrimitiveType

public static String getPrimitiveType(String className)

isPrimitiveClass

public static boolean isPrimitiveClass(String className)

convertClassToSourcePath

public static String convertClassToSourcePath(String className,
                                              String fileExtension)

isFullClass

public static boolean isFullClass(String className)

getClassFromFullClass

public static String getClassFromFullClass(String fullClass)
Extract the simple class name from a fully-qualified classname.

Given a string like "org.apache.Foo", this method returns "Foo".


getPackageFromFullClass

public static String getPackageFromFullClass(String fullClass)

getConstantNameFromProperty

public static String getConstantNameFromProperty(String propertyName)

getConstantNameFromProperty

public static String getConstantNameFromProperty(String propertyName,
                                                 String constantSuffix)

getPropertyClass

public static String getPropertyClass(PropertyMeta property)

getMethodNameFromEvent

public static String getMethodNameFromEvent(String methodPrefix,
                                            String eventName,
                                            String methodSuffix)

getEventNameFromEventType

public static String getEventNameFromEventType(String eventFullClass)

primitiveDefaultValue

public static String primitiveDefaultValue(String className)

fill

public static String fill(String base,
                          int length)

getVariableFromClass

public static String getVariableFromClass(String className)

convertStringToLiteral

public static String convertStringToLiteral(String value)

convertStringToLiteral

public static String convertStringToLiteral(String className,
                                            String value)

getDefaultValue

public static String getDefaultValue(PropertyMeta property)

getDefaultValueField

public static String getDefaultValueField(PropertyMeta property)


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.