Template::Plugin::Java::Utils - Utility functions for Template::Plugin::Java.


Template-Plugin-Java documentation  | view source Contained in the Template-Plugin-Java distribution.

Index


NAME

Top

Template::Plugin::Java::Utils - Utility functions for Template::Plugin::Java.

SYNOPSIS

Top

	use Template::Plugin::Java::Utils qw/list of subroutines to import/;

SUBROUTINES

Top

createTemplate

Creates a new Template with reasonable options.

parseOptions

Replaces c_c with cC and nosomething=whatever with something=0 in the keys of a hash.

setOption

Adds to or sets an option in a hash, supports nested arrays and boolean options. The logic here is one of those things that just works the way it is and seems decipherable, but don't mess with it.

parseCmdLine

Parses @ARGV into a hash of options and values, leaving everything else that is most likely a list of files on @ARGV.

sqlType2JavaType( type_name [, precision for numeric types] )

Maps some ANSI SQL data types to the closest Java variable types. The default case is byte[] for unrecognized sql types.

simplifyPath( path )

Remove any dir/../ or /./ or extraneous / from a path, as well as prepending the current directory if necessary.

findPackageDir( directory )

Find package in $ENV{CLASSPATH}.

determinePackage([ optional directory ])

Determine the package of the current or passed-in directory.

isNum( string )

Determines whether a string is a number or not. Uses the more powerful DBI::looks_like_number heuristic if available.

castJavaString( variable_name, target_type )

Casts a java String to another type using the appropriate code.

javaTypeName( javaType )

Transform a java type name to a character string version. In other words, String remains String, but byte[] becomes byteArray.

ENVIRONMENT

Top

These are the environment variables used.

TEMPLATEPATH

Colon separated path to where templates can be found, used by default in the createTemplate subroutine.

CLASSPATH

Searched in findPackageDir to find a directory relative to it.

AUTHOR

Top

Rafael Kitover (caelum@debian.org)

COPYRIGHT

Top

BUGS

Top

None known.

TODO

Top

Nothing here.

SEE ALSO

Top

perl(1), Template(3), Template::Plugin::Java(3), Template::Plugin::JavaSQL(3) Template::Plugin::Java::Constants(3),


Template-Plugin-Java documentation  | view source Contained in the Template-Plugin-Java distribution.