Java Doc for CompilerConfig.java in  » Installer » IzPack » com » izforge » izpack » compiler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Installer » IzPack » com.izforge.izpack.compiler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.Thread
      com.izforge.izpack.compiler.CompilerConfig

CompilerConfig
public class CompilerConfig extends Thread (Code)
A parser for the installer xml configuration. This parses a document conforming to the installation.dtd and populates a Compiler instance to perform the install compilation.
author:
   Scott Stark
version:
   $Revision: 2061 $


Field Summary
final public static  StringSTANDARD
     Standard installer.
final public static  StringVERSION
     The compiler version.
final public static  StringWEB
     Web installer.
protected  Stringbasedir
     The base directory.
protected  List<CompilerListener>compilerListeners
    

Constructor Summary
public  CompilerConfig(String filename, String basedir, String kind, String output)
     The constructor.
public  CompilerConfig(String filename, String basedir, String kind, String output, PackagerListener listener)
     The constructor.
public  CompilerConfig(String filename, String base, String kind, String output, String compr_format, PackagerListener listener)
    
public  CompilerConfig(String basedir, String kind, String output, PackagerListener listener, String installText)
    
public  CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, PackagerListener listener, String installText)
    
public  CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText)
    

Method Summary
protected  voidaddArchiveContent(File baseDir, File archive, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition)
    
protected  voidaddConditions(XMLElement data)
     Parse conditions and add them to the compiler.
protected  voidaddDynamicVariables(XMLElement data)
    
protected  voidaddGUIPrefs(XMLElement data)
     Returns the GUIPrefs.
protected  voidaddInfo(XMLElement data)
     Builds the Info class from the XML tree.
Parameters:
  data - The XML data.
protected  voidaddJars(XMLElement data)
     Add project specific external jar files to the installer.
protected  voidaddLangpacks(XMLElement data)
     Adds the ISO3 codes of the langpacks and associated resources.
protected  voidaddNativeLibraries(XMLElement data)
     Add native libraries to the installer.
protected  voidaddPacks(XMLElement data)
     Add packs and their contents to the installer.
protected  voidaddPanels(XMLElement data)
     Parse panels and their paramters, locate the panels resources and add to the Packager.
public  booleanaddProperty(String name, String value)
     Add a name value pair to the project property set.
protected  voidaddRecursively(File baseDir, File file, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition)
     Recursive method to add files in a pack.
protected  voidaddResources(XMLElement data)
     Adds the resources.
protected  voidaddVariables(XMLElement data)
     Variable declaration is a fragment of the xml file.
public  voidcheckDependencies(List<PackInfo> packs)
     Checks whether the dependencies stated in the configuration file are correct.
public  voidcompile()
    
public  voidexecuteCompiler()
     Compiles the installation.
public  CompilergetCompiler()
    
protected  intgetOverrideValue(XMLElement f)
    
public  PackagerListenergetPackagerListener()
    
protected  XMLElementgetXMLTree()
     Returns the XMLElement representing the installation XML file.
public static  voidmain(String[] args)
     The main method if the compiler is invoked by a command-line call.
protected  voidparseError(String message)
     Create parse error with consistent messages.
protected  voidparseError(XMLElement parent, String message)
     Create parse error with consistent messages.
protected  voidparseError(XMLElement parent, String message, Throwable cause)
     Create a chained parse error with consistent messages.
protected  voidparseWarn(XMLElement parent, String message)
     Create a parse warning with consistent messages.
protected  StringrequireAttribute(XMLElement element, String attribute)
     Call getAttribute on an element, producing a meaningful error message if not present, or empty.
protected  XMLElementrequireChildNamed(XMLElement parent, String name)
     Call getFirstChildNamed on the parent, producing a meaningful error message on failure.
protected  StringrequireContent(XMLElement element)
     Call getContent on an element, producing a meaningful error message if not present, or empty.
protected  intrequireIntAttribute(XMLElement element, String attribute)
     Get a required attribute of an element, ensuring it is an integer.
protected  URLrequireURLContent(XMLElement element)
     Call getContent on an element, producing a meaningful error message if not present, or empty, or a valid URL.
protected  booleanrequireYesNoAttribute(XMLElement element, String attribute)
     Call getAttribute on an element, producing a meaningful error message if not present, or one of "yes" or "no".
public  voidrun()
     The run() method.
public static  voidsetIzpackHome(String izHome)
    
protected  voidsubstituteAllProperties(XMLElement element)
    
protected  voidsubstituteProperties(XMLElement data)
     Properties declaration is a fragment of the xml file.
protected  booleanvalidateYesNo(String value)
    
protected  booleanvalidateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue)
     Call getAttribute on an element, producing a meaningful warning if not "yes" or "no".
public  booleanwasSuccessful()
    

Field Detail
STANDARD
final public static String STANDARD(Code)
Standard installer.



VERSION
final public static String VERSION(Code)
The compiler version.



WEB
final public static String WEB(Code)
Web installer.



basedir
protected String basedir(Code)
The base directory.



compilerListeners
protected List<CompilerListener> compilerListeners(Code)
List of CompilerListeners which should be called at packaging




Constructor Detail
CompilerConfig
public CompilerConfig(String filename, String basedir, String kind, String output) throws CompilerException(Code)
The constructor.
Parameters:
  filename - The XML filename.
Parameters:
  basedir - The base directory.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
throws:
  CompilerException -



CompilerConfig
public CompilerConfig(String filename, String basedir, String kind, String output, PackagerListener listener) throws CompilerException(Code)
The constructor.
Parameters:
  filename - The XML filename.
Parameters:
  basedir - The base directory.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
Parameters:
  listener - The PackagerListener.
throws:
  CompilerException -



CompilerConfig
public CompilerConfig(String filename, String base, String kind, String output, String compr_format, PackagerListener listener) throws CompilerException(Code)

Parameters:
  filename - The XML filename.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
Parameters:
  compr_format - The compression format to be used for packs.
Parameters:
  listener - The PackagerListener.
throws:
  CompilerException -



CompilerConfig
public CompilerConfig(String basedir, String kind, String output, PackagerListener listener, String installText) throws CompilerException(Code)

Parameters:
  basedir - The base directory.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
Parameters:
  listener - The PackagerListener.
Parameters:
  installText - The install xml configuration text
throws:
  CompilerException -



CompilerConfig
public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, PackagerListener listener, String installText) throws CompilerException(Code)

Parameters:
  filename - The XML filename.
Parameters:
  basedir - The base directory.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
Parameters:
  compr_format - The compression format to be used for packs.
Parameters:
  listener - The PackagerListener.
Parameters:
  installText - The install xml configuration text
throws:
  CompilerException -



CompilerConfig
public CompilerConfig(String filename, String basedir, String kind, String output, String compr_format, int compr_level, PackagerListener listener, String installText) throws CompilerException(Code)

Parameters:
  filename - The XML filename.
Parameters:
  basedir - The base directory.
Parameters:
  kind - The installer kind.
Parameters:
  output - The installer filename.
Parameters:
  compr_format - The compression format to be used for packs.
Parameters:
  compr_level - Compression level to be used if supported.
Parameters:
  listener - The PackagerListener.
Parameters:
  installText - The install xml configuration text
throws:
  CompilerException -




Method Detail
addArchiveContent
protected void addArchiveContent(File baseDir, File archive, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) throws IOException(Code)
Add files in an archive to a pack
Parameters:
  archive - the archive file to unpack
Parameters:
  targetdir - the target directory where the content of the archive will be installed
Parameters:
  osList - The target OS constraints.
Parameters:
  override - Overriding behaviour.
Parameters:
  pack - Pack to be packed into
Parameters:
  additionals - Map which contains additional data
Parameters:
  condition -



addConditions
protected void addConditions(XMLElement data) throws CompilerException(Code)
Parse conditions and add them to the compiler.
Parameters:
  data -
throws:
  CompilerException -



addDynamicVariables
protected void addDynamicVariables(XMLElement data) throws CompilerException(Code)



addGUIPrefs
protected void addGUIPrefs(XMLElement data) throws CompilerException(Code)
Returns the GUIPrefs.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



addInfo
protected void addInfo(XMLElement data) throws Exception(Code)
Builds the Info class from the XML tree.
Parameters:
  data - The XML data. return The Info.
exception:
  Exception - Description of the Exception



addJars
protected void addJars(XMLElement data) throws Exception(Code)
Add project specific external jar files to the installer.
Parameters:
  data - The XML data.



addLangpacks
protected void addLangpacks(XMLElement data) throws CompilerException(Code)
Adds the ISO3 codes of the langpacks and associated resources.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



addNativeLibraries
protected void addNativeLibraries(XMLElement data) throws Exception(Code)
Add native libraries to the installer.
Parameters:
  data - The XML data.



addPacks
protected void addPacks(XMLElement data) throws CompilerException(Code)
Add packs and their contents to the installer.
Parameters:
  data - The XML data.



addPanels
protected void addPanels(XMLElement data) throws CompilerException(Code)
Parse panels and their paramters, locate the panels resources and add to the Packager.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



addProperty
public boolean addProperty(String name, String value)(Code)
Add a name value pair to the project property set. It is not replaced it is already in the set of properties.
Parameters:
  name - the name of the property
Parameters:
  value - the value to set true if the property was not already set



addRecursively
protected void addRecursively(File baseDir, File file, String targetdir, List<OsConstraint> osList, int override, PackInfo pack, Map additionals, String condition) throws IOException(Code)
Recursive method to add files in a pack.
Parameters:
  file - The file to add.
Parameters:
  targetdir - The relative path to the parent.
Parameters:
  osList - The target OS constraints.
Parameters:
  override - Overriding behaviour.
Parameters:
  pack - Pack to be packed into
Parameters:
  additionals - Map which contains additional data
Parameters:
  condition -
exception:
  FileNotFoundException - if the file does not exist



addResources
protected void addResources(XMLElement data) throws CompilerException(Code)
Adds the resources.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



addVariables
protected void addVariables(XMLElement data) throws CompilerException(Code)
Variable declaration is a fragment of the xml file. For example:
 <variables>
 <variable name="nom" value="value"/>
 <variable name="foo" value="pippo"/>
 </variables>
 
variable declared in this can be referred to in parsable files.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



checkDependencies
public void checkDependencies(List<PackInfo> packs) throws CompilerException(Code)
Checks whether the dependencies stated in the configuration file are correct. Specifically it checks that no pack point to a non existent pack and also that there are no circular dependencies in the packs.



compile
public void compile()(Code)
Compile the installation



executeCompiler
public void executeCompiler() throws Exception(Code)
Compiles the installation.
exception:
  Exception - Description of the Exception



getCompiler
public Compiler getCompiler()(Code)
Access the install compiler the install compiler



getOverrideValue
protected int getOverrideValue(XMLElement f) throws CompilerException(Code)



getPackagerListener
public PackagerListener getPackagerListener()(Code)
Retrieves the packager listener



getXMLTree
protected XMLElement getXMLTree() throws CompilerException, IOException(Code)
Returns the XMLElement representing the installation XML file. The XML tree.
exception:
  CompilerException - For problems with the installation file
exception:
  IOException - for errors reading the installation file



main
public static void main(String[] args)(Code)
The main method if the compiler is invoked by a command-line call.
Parameters:
  args - The arguments passed on the command-line.



parseError
protected void parseError(String message) throws CompilerException(Code)
Create parse error with consistent messages. Includes file name. For use When parent is unknown.
Parameters:
  message - Brief message explaining error



parseError
protected void parseError(XMLElement parent, String message) throws CompilerException(Code)
Create parse error with consistent messages. Includes file name and line # of parent. It is an error for 'parent' to be null.
Parameters:
  parent - The element in which the error occured
Parameters:
  message - Brief message explaining error



parseError
protected void parseError(XMLElement parent, String message, Throwable cause) throws CompilerException(Code)
Create a chained parse error with consistent messages. Includes file name and line # of parent. It is an error for 'parent' to be null.
Parameters:
  parent - The element in which the error occured
Parameters:
  message - Brief message explaining error



parseWarn
protected void parseWarn(XMLElement parent, String message)(Code)
Create a parse warning with consistent messages. Includes file name and line # of parent. It is an error for 'parent' to be null.
Parameters:
  parent - The element in which the warning occured
Parameters:
  message - Warning message



requireAttribute
protected String requireAttribute(XMLElement element, String attribute) throws CompilerException(Code)
Call getAttribute on an element, producing a meaningful error message if not present, or empty. It is an error for 'element' or 'attribute' to be null.
Parameters:
  element - The element to get the attribute value of
Parameters:
  attribute - The name of the attribute to get



requireChildNamed
protected XMLElement requireChildNamed(XMLElement parent, String name) throws CompilerException(Code)
Call getFirstChildNamed on the parent, producing a meaningful error message on failure. It is an error for 'parent' to be null.
Parameters:
  parent - The element to search for a child
Parameters:
  name - Name of the child element to get



requireContent
protected String requireContent(XMLElement element) throws CompilerException(Code)
Call getContent on an element, producing a meaningful error message if not present, or empty. It is an error for 'element' to be null.
Parameters:
  element - The element to get content of



requireIntAttribute
protected int requireIntAttribute(XMLElement element, String attribute) throws CompilerException(Code)
Get a required attribute of an element, ensuring it is an integer. A meaningful error message is generated as a CompilerException if not present or parseable as an int. It is an error for 'element' or 'attribute' to be null.
Parameters:
  element - The element to get the attribute value of
Parameters:
  attribute - The name of the attribute to get



requireURLContent
protected URL requireURLContent(XMLElement element) throws CompilerException(Code)
Call getContent on an element, producing a meaningful error message if not present, or empty, or a valid URL. It is an error for 'element' to be null.
Parameters:
  element - The element to get content of



requireYesNoAttribute
protected boolean requireYesNoAttribute(XMLElement element, String attribute) throws CompilerException(Code)
Call getAttribute on an element, producing a meaningful error message if not present, or one of "yes" or "no". It is an error for 'element' or 'attribute' to be null.
Parameters:
  element - The element to get the attribute value of
Parameters:
  attribute - The name of the attribute to get



run
public void run()(Code)
The run() method.



setIzpackHome
public static void setIzpackHome(String izHome)(Code)
Set the IzPack home directory
Parameters:
  izHome - - the izpack home directory



substituteAllProperties
protected void substituteAllProperties(XMLElement element) throws CompilerException(Code)
Perform recursive substitution on all properties



substituteProperties
protected void substituteProperties(XMLElement data) throws CompilerException(Code)
Properties declaration is a fragment of the xml file. For example:
 <properties>
 <property name="app.name" value="Property Laden Installer"/>
 <!-- Ant styles 'location' and 'refid' are not yet supported -->
 <property file="filename-relative-to-install?"/>
 <property file="filename-relative-to-install?" prefix="prefix"/>
 <!-- Ant style 'url' and 'resource' are not yet supported -->
 <property environment="prefix"/>
 </properties>
 
variable declared in this can be referred to in parsable files.
Parameters:
  data - The XML data.
exception:
  CompilerException - Description of the Exception



validateYesNo
protected boolean validateYesNo(String value)(Code)



validateYesNoAttribute
protected boolean validateYesNoAttribute(XMLElement element, String attribute, boolean defaultValue)(Code)
Call getAttribute on an element, producing a meaningful warning if not "yes" or "no". If the 'element' or 'attribute' are null, the default value is returned.
Parameters:
  element - The element to get the attribute value of
Parameters:
  attribute - The name of the attribute to get
Parameters:
  defaultValue - Value returned if attribute not present or invalid



wasSuccessful
public boolean wasSuccessful()(Code)



Fields inherited from java.lang.Thread
final public static int MAX_PRIORITY(Code)(Java Doc)
final public static int MIN_PRIORITY(Code)(Java Doc)
final public static int NORM_PRIORITY(Code)(Java Doc)

Methods inherited from java.lang.Thread
public static int activeCount()(Code)(Java Doc)
final public void checkAccess()(Code)(Java Doc)
native public int countStackFrames()(Code)(Java Doc)
native public static Thread currentThread()(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
public static void dumpStack()(Code)(Java Doc)
public static int enumerate(Thread tarray)(Code)(Java Doc)
public static Map<Thread, StackTraceElement[]> getAllStackTraces()(Code)(Java Doc)
public ClassLoader getContextClassLoader()(Code)(Java Doc)
public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler()(Code)(Java Doc)
public long getId()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public int getPriority()(Code)(Java Doc)
public StackTraceElement[] getStackTrace()(Code)(Java Doc)
public State getState()(Code)(Java Doc)
final public ThreadGroup getThreadGroup()(Code)(Java Doc)
public UncaughtExceptionHandler getUncaughtExceptionHandler()(Code)(Java Doc)
native public static boolean holdsLock(Object obj)(Code)(Java Doc)
public void interrupt()(Code)(Java Doc)
public static boolean interrupted()(Code)(Java Doc)
final native public boolean isAlive()(Code)(Java Doc)
final public boolean isDaemon()(Code)(Java Doc)
public boolean isInterrupted()(Code)(Java Doc)
final public synchronized void join(long millis) throws InterruptedException(Code)(Java Doc)
final public synchronized void join(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void join() throws InterruptedException(Code)(Java Doc)
final public void resume()(Code)(Java Doc)
public void run()(Code)(Java Doc)
public void setContextClassLoader(ClassLoader cl)(Code)(Java Doc)
final public void setDaemon(boolean on)(Code)(Java Doc)
public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
final public void setName(String name)(Code)(Java Doc)
final public void setPriority(int newPriority)(Code)(Java Doc)
public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh)(Code)(Java Doc)
native public static void sleep(long millis) throws InterruptedException(Code)(Java Doc)
public static void sleep(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
public synchronized void start()(Code)(Java Doc)
final public void stop()(Code)(Java Doc)
final public synchronized void stop(Throwable obj)(Code)(Java Doc)
final public void suspend()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
native public static void yield()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.