Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.cantaloop.cgimlet.lang.java
Class JLanguageFactory  view JLanguageFactory download JLanguageFactory.java

java.lang.Object
  extended byorg.cantaloop.cgimlet.lang.java.JLanguageFactory
All Implemented Interfaces:
org.cantaloop.cgimlet.lang.LanguageFactory

public final class JLanguageFactory
extends java.lang.Object
implements org.cantaloop.cgimlet.lang.LanguageFactory

Implementation of org.cantaloop.cgimlet.lang.LanguageFactory for the java programming language.

Version:
@version@ ($Revision: 1.5 $)

Nested Class Summary
static class JLanguageFactory.JModifier
           
 
Field Summary
private static org.cantaloop.cgimlet.lang.Type BOOL_TYPE
           
private static org.cantaloop.cgimlet.lang.Type DOUBLE_TYPE
           
private static org.cantaloop.cgimlet.lang.Type INT_TYPE
           
private static org.cantaloop.cgimlet.lang.Type LIST_TYPE
           
private static org.cantaloop.cgimlet.lang.Type MAP_TYPE
           
private static JLanguageFactory s_instance
           
private static org.cantaloop.cgimlet.lang.Type SET_TYPE
           
private static org.cantaloop.cgimlet.lang.Type STRING_TYPE
           
private static org.cantaloop.cgimlet.lang.Type VOID_TYPE
           
 
Constructor Summary
private JLanguageFactory()
           
 
Method Summary
 org.cantaloop.cgimlet.lang.Type getBoolType()
          Returns the type that represents a boolean in the concrete programming language.
 org.cantaloop.cgimlet.lang.ClassTemplate getClassTemplate(java.lang.String pkg, java.lang.String name)
          Returns a template for a class in the package pkg with name name.
 org.cantaloop.cgimlet.lang.CodeWriter getCodeWriter()
           
 org.cantaloop.cgimlet.lang.CodeCompiler getCompiler()
           
 org.cantaloop.cgimlet.lang.FieldTemplate getConstantFieldTemplate(org.cantaloop.cgimlet.lang.Type type, java.lang.String name)
          Returns a template for a field that represents a constant.
 org.cantaloop.cgimlet.lang.Type getDoubleType()
          Returns the type that represents a floating-point number in the concrete programming language.
 org.cantaloop.cgimlet.lang.FieldTemplate getFieldTemplate(org.cantaloop.cgimlet.lang.Type type, java.lang.String name)
           
static org.cantaloop.cgimlet.lang.LanguageFactory getInstance()
           
 org.cantaloop.cgimlet.lang.Type getIntType()
          Returns the type that represents a integer in the concrete programming language.
 org.cantaloop.cgimlet.lang.Type getListType()
          Returns the type that represent a list in the concrete programming language.
 org.cantaloop.cgimlet.lang.Type getMapType()
          Returns the type that represents a map (sometimes also called dictionary or associative array) in the concrete programming language.
 org.cantaloop.cgimlet.lang.MethodTemplate getMethodTemplate(java.lang.String name)
           
 org.cantaloop.cgimlet.lang.Modifier getModifier()
           
 org.cantaloop.cgimlet.lang.Modifier getModifier(org.cantaloop.cgimlet.lang.Modifier.Access access, boolean isStatic, boolean isFinal)
           
 org.cantaloop.cgimlet.lang.Type getSetType()
          Returns the type that represent a set in the concrete programming language.
 org.cantaloop.cgimlet.lang.Type getStringType()
          Returns the type that represents a string in the concrete programming language.
 org.cantaloop.cgimlet.lang.Type getType(java.lang.String name)
          Returns a type for the given name.
 org.cantaloop.cgimlet.lang.CGUtils getUtils()
           
 org.cantaloop.cgimlet.lang.Type getVoidType()
          Returns the type that represent no type in the concrete programming language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_instance

private static final JLanguageFactory s_instance

MAP_TYPE

private static final org.cantaloop.cgimlet.lang.Type MAP_TYPE

SET_TYPE

private static final org.cantaloop.cgimlet.lang.Type SET_TYPE

LIST_TYPE

private static final org.cantaloop.cgimlet.lang.Type LIST_TYPE

STRING_TYPE

private static final org.cantaloop.cgimlet.lang.Type STRING_TYPE

INT_TYPE

private static final org.cantaloop.cgimlet.lang.Type INT_TYPE

BOOL_TYPE

private static final org.cantaloop.cgimlet.lang.Type BOOL_TYPE

DOUBLE_TYPE

private static final org.cantaloop.cgimlet.lang.Type DOUBLE_TYPE

VOID_TYPE

private static final org.cantaloop.cgimlet.lang.Type VOID_TYPE
Constructor Detail

JLanguageFactory

private JLanguageFactory()
Method Detail

getInstance

public static org.cantaloop.cgimlet.lang.LanguageFactory getInstance()

getCodeWriter

public final org.cantaloop.cgimlet.lang.CodeWriter getCodeWriter()
Specified by:
getCodeWriter in interface org.cantaloop.cgimlet.lang.LanguageFactory

getUtils

public final org.cantaloop.cgimlet.lang.CGUtils getUtils()
Specified by:
getUtils in interface org.cantaloop.cgimlet.lang.LanguageFactory

getModifier

public org.cantaloop.cgimlet.lang.Modifier getModifier()
Specified by:
getModifier in interface org.cantaloop.cgimlet.lang.LanguageFactory

getModifier

public org.cantaloop.cgimlet.lang.Modifier getModifier(org.cantaloop.cgimlet.lang.Modifier.Access access,
                                                       boolean isStatic,
                                                       boolean isFinal)
Specified by:
getModifier in interface org.cantaloop.cgimlet.lang.LanguageFactory

getClassTemplate

public final org.cantaloop.cgimlet.lang.ClassTemplate getClassTemplate(java.lang.String pkg,
                                                                       java.lang.String name)
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns a template for a class in the package pkg with name name.

Specified by:
getClassTemplate in interface org.cantaloop.cgimlet.lang.LanguageFactory

getMethodTemplate

public final org.cantaloop.cgimlet.lang.MethodTemplate getMethodTemplate(java.lang.String name)
Specified by:
getMethodTemplate in interface org.cantaloop.cgimlet.lang.LanguageFactory

getFieldTemplate

public final org.cantaloop.cgimlet.lang.FieldTemplate getFieldTemplate(org.cantaloop.cgimlet.lang.Type type,
                                                                       java.lang.String name)
Specified by:
getFieldTemplate in interface org.cantaloop.cgimlet.lang.LanguageFactory

getConstantFieldTemplate

public org.cantaloop.cgimlet.lang.FieldTemplate getConstantFieldTemplate(org.cantaloop.cgimlet.lang.Type type,
                                                                         java.lang.String name)
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns a template for a field that represents a constant.

Specified by:
getConstantFieldTemplate in interface org.cantaloop.cgimlet.lang.LanguageFactory

getStringType

public final org.cantaloop.cgimlet.lang.Type getStringType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represents a string in the concrete programming language.

Specified by:
getStringType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getIntType

public final org.cantaloop.cgimlet.lang.Type getIntType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represents a integer in the concrete programming language.

Specified by:
getIntType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getDoubleType

public final org.cantaloop.cgimlet.lang.Type getDoubleType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represents a floating-point number in the concrete programming language.

Specified by:
getDoubleType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getBoolType

public final org.cantaloop.cgimlet.lang.Type getBoolType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represents a boolean in the concrete programming language.

Specified by:
getBoolType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getMapType

public final org.cantaloop.cgimlet.lang.Type getMapType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represents a map (sometimes also called dictionary or associative array) in the concrete programming language.

Specified by:
getMapType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getSetType

public final org.cantaloop.cgimlet.lang.Type getSetType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represent a set in the concrete programming language.

Specified by:
getSetType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getListType

public final org.cantaloop.cgimlet.lang.Type getListType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represent a list in the concrete programming language.

Specified by:
getListType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getVoidType

public final org.cantaloop.cgimlet.lang.Type getVoidType()
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns the type that represent no type in the concrete programming language.

Specified by:
getVoidType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getType

public final org.cantaloop.cgimlet.lang.Type getType(java.lang.String name)
Description copied from interface: org.cantaloop.cgimlet.lang.LanguageFactory
Returns a type for the given name.

Specified by:
getType in interface org.cantaloop.cgimlet.lang.LanguageFactory

getCompiler

public final org.cantaloop.cgimlet.lang.CodeCompiler getCompiler()
Specified by:
getCompiler in interface org.cantaloop.cgimlet.lang.LanguageFactory