Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


org.eclipse.jet.core.parser.ast
Class JETCompilationUnit

java.lang.Object
  extended by 

org.eclipse.jet.core.parser.ast.JETASTElement
      extended by 
org.eclipse.jet.core.parser.ast.JETCompilationUnit

public final class JETCompilationUnit
extends JETASTElement

Represent a compilation unit (a template) in the JET AST.


Method Summary
protected  void accept0 ( JETASTVisitor visitor)
          Visit the AST and its contained elements.
 void addBodyElement ( BodyElement bodyElement)
           
 void addImports (java.util.List list)
           
 void createProblem ( ProblemSeverity error, int problemId, java.lang.String message, java.lang.Object[] messageArgs, int start, int end, int line, int colOffset)
          Create a new problem on the compilation unit
  JETASTElement elementAfter ( JETASTElement element)
           
  BodyElement elementBefore ( JETASTElement element)
           
 java.util.List getBodyElements ()
          Return a List of JET2 AST element (@link JETASTElement} instances.
 java.util.Set getImports ()
           
 java.lang.String getOutputEncoding ()
          Return the output encoding for the template
 java.lang.String getOutputJavaClassName ()
          Return the unqualified name of the Java class into which the compilation unit will be compiled.
 java.lang.String getOutputJavaPackage ()
          Return the name of the Java package to which the compilation unit will be compiled.
 java.util.List getProblems ()
          Return a list of problems discovered in the compilation unit
  TagLibraryReference[] getTagLibraryReferences ()
          Return an array of tag libraries referenced by this template.
 boolean hasErrors ()
          Test if the compilation unit has any errors
 boolean hasWarnings ()
          Test if the compilation unit has any warnings
 boolean removeLineWhenOtherwiseEmpty ()
          Indicate whether the the surrounding whitespace, including the trailing new line should be removed from the template output.
 void setOutputJavaClassName (java.lang.String outputJavaClassName)
          Set the unqualifeid name of the Java class into which the compilation unit will be compiled.
 void setOutputJavaPackage (java.lang.String outputJavaPackage)
          Set the Java package into which the compilation unit will be compiled.
 void setPredefinedTagLibraries (java.util.Map predefinedLibraryMap)
          Define tag library prefixes (and associated tag library ids) that are automatically available to the transform.
 void setTagLibraryReferences ( TagLibraryReference[] tagLibraryReferences)
          Set the tag libraries referenced by this template
 
Methods inherited from class org.eclipse.jet.core.parser.ast. JETASTElement
accept, getAst, getColumn, getEnd, getLine, getNextElement, getParent, getPrevElement, getStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setPredefinedTagLibraries

public void setPredefinedTagLibraries(java.util.Map predefinedLibraryMap)
Define tag library prefixes (and associated tag library ids) that are automatically available to the transform.

Parameters:
predefinedLibraryMap - a map from prefix to tag library id.

getBodyElements

public final java.util.List getBodyElements()
Return a List of JET2 AST element (@link JETASTElement} instances.

Returns:
a List. The empty list of there are no body elements.

addBodyElement

public final void addBodyElement(
BodyElement bodyElement)

accept0

protected final void accept0(
JETASTVisitor visitor)
Description copied from class: JETASTElement
Visit the AST and its contained elements.

Specified by:
accept0 in class JETASTElement
See Also:
JETASTElement.accept0(JETASTVisitor)

getProblems

public java.util.List getProblems()
Return a list of problems discovered in the compilation unit

Returns:
a List of Problem objects. The empty list is returned if no problems were found.

hasErrors

public boolean hasErrors()
Test if the compilation unit has any errors

Returns:
true if the compilation unit had errors, false otherwise.

hasWarnings

public boolean hasWarnings()
Test if the compilation unit has any warnings

Returns:
true if the compilation unit had warnings, false otherwise.

createProblem

public void createProblem(
ProblemSeverity error,
                          int problemId,
                          java.lang.String message,
                          java.lang.Object[] messageArgs,
                          int start,
                          int end,
                          int line,
                          int colOffset)
Create a new problem on the compilation unit

Parameters:
error - the severity of the problem
problemId - the problem id. A value from Problem static files
message - an error message, with optional replacement tokens
messageArgs - the error message arguments
start - the start offset of the problem (doc relative)
end - the end offset of the problem (doc relative)
line - the line number of the problem (1 based)
colOffset - TODO

getOutputJavaPackage

public java.lang.String getOutputJavaPackage()
Return the name of the Java package to which the compilation unit will be compiled.

Returns:
a string

getOutputJavaClassName

public java.lang.String getOutputJavaClassName()
Return the unqualified name of the Java class into which the compilation unit will be compiled.

Returns:
Returns the outputJavaClassName.

setOutputJavaClassName

public void setOutputJavaClassName(java.lang.String outputJavaClassName)
Set the unqualifeid name of the Java class into which the compilation unit will be compiled.

Parameters:
outputJavaClassName - The outputJavaClassName to set.

setOutputJavaPackage

public void setOutputJavaPackage(java.lang.String outputJavaPackage)
Set the Java package into which the compilation unit will be compiled.

Parameters:
outputJavaPackage - The outputJavaPackage to set.

removeLineWhenOtherwiseEmpty

public boolean removeLineWhenOtherwiseEmpty()
Description copied from class: JETASTElement
Indicate whether the the surrounding whitespace, including the trailing new line should be removed from the template output. In general, elements that create output should return false, while element that do should should return true.

Specified by:
removeLineWhenOtherwiseEmpty in class JETASTElement
Returns:
true if the containing line should be removed if otherwise empty.

getTagLibraryReferences

public 
TagLibraryReference[] getTagLibraryReferences()
Return an array of tag libraries referenced by this template.

Returns:
a possibly empty array of tag library references.

addImports

public void addImports(java.util.List list)

getImports

public java.util.Set getImports()

setTagLibraryReferences

public void setTagLibraryReferences(
TagLibraryReference[] tagLibraryReferences)
Set the tag libraries referenced by this template

Parameters:
tagLibraryReferences - the tag library references
Since:
0.8.0

getOutputEncoding

public java.lang.String getOutputEncoding()
Return the output encoding for the template

Returns:
the output encoding
Since:
0.8.0

elementAfter

public 
JETASTElement elementAfter(
JETASTElement element)

elementBefore

public 
BodyElement elementBefore(
JETASTElement element)

Copyright 2006 IBM Corporation and others.
All Rights Reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire