Java Doc for SpecHelper.java in  » Installer » IzPack » com » izforge » izpack » util » 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.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.izforge.izpack.util.SpecHelper

SpecHelper
public class SpecHelper (Code)
This class contains some helper methods to simplify handling of xml specification files.
author:
   Klaus Bartz


Field Summary
final public static  StringNO
    
final public static  StringYES
    

Constructor Summary
public  SpecHelper()
     The default constructor.

Method Summary
public  Vector<XMLElement>getAllSubChildren(XMLElement root, String[] childdef)
     Returns a Vector with all leafs of the tree which is described with childdef.
public  XMLElementgetPackForName(String packDestName)
     Returns a XML element which represents the pack for the given name.
public  StringgetRequiredAttribute(XMLElement element, String attrName)
     Returns the attribute for the given attribute name.
public  InputStreamgetResource(String res)
     Gets the stream to a resource.
Parameters:
  res - The resource id.
public  XMLElementgetSpec()
     Returns the specification.
public  booleanhaveSpec()
     Returns true if a specification exist, else false.
public  booleanisAttributeYes(XMLElement element, String attribute, boolean defaultValue)
     Returns whether the value to the given attribute is "yes" or not.
public  voidparseError(XMLElement parent, String message)
     Create parse error with consistent messages.
public  voidreadSpec(String specFileName)
     Reads the XML specification given by the file name.
public  voidreadSpec(String specFileName, VariableSubstitutor substitutor)
     Reads the XML specification given by the file name.
public  voidreadSpec(InputStream input)
     Reads the XML specification given by the input stream.
public  voidreadSpec(InputStream input, VariableSubstitutor substitutor)
     Reads the XML specification given by the input stream.
public  voidsetSpec(XMLElement element)
     Sets the specifaction to the given XML element.
public  InputStreamsubstituteVariables(InputStream input, VariableSubstitutor substitutor)
     Creates an temp file in to the substitutor the substituted contents of input writes; close it and (re)open it as FileInputStream.

Field Detail
NO
final public static String NO(Code)



YES
final public static String YES(Code)




Constructor Detail
SpecHelper
public SpecHelper()(Code)
The default constructor.




Method Detail
getAllSubChildren
public Vector<XMLElement> getAllSubChildren(XMLElement root, String[] childdef)(Code)
Returns a Vector with all leafs of the tree which is described with childdef.
Parameters:
  root - the XMLElement which is the current root for the search
Parameters:
  childdef - a String array which describes the tree; the last element contains the leafname a Vector of XMLElements of all leafs founded under root



getPackForName
public XMLElement getPackForName(String packDestName)(Code)
Returns a XML element which represents the pack for the given name.
Parameters:
  packDestName - name of the pack which should be returned a XML element which represents the pack for the given name



getRequiredAttribute
public String getRequiredAttribute(XMLElement element, String attrName) throws InstallerException(Code)
Returns the attribute for the given attribute name. If no attribute exist, an InstallerException with a detail message is thrown.
Parameters:
  element - XML element which should contain the attribute
Parameters:
  attrName - key of the attribute the attribute as string
throws:
  InstallerException -



getResource
public InputStream getResource(String res)(Code)
Gets the stream to a resource.
Parameters:
  res - The resource id. The resource value, null if not found



getSpec
public XMLElement getSpec()(Code)
Returns the specification. the specification



haveSpec
public boolean haveSpec()(Code)
Returns true if a specification exist, else false. true if a specification exist, else false



isAttributeYes
public boolean isAttributeYes(XMLElement element, String attribute, boolean defaultValue)(Code)
Returns whether the value to the given attribute is "yes" or not. If the attribute does not exist, or the value is not "yes" and not "no", the default value is returned.
Parameters:
  element - the XML element which contains the attribute
Parameters:
  attribute - the name of the attribute
Parameters:
  defaultValue - the default value whether the value to the given attribute is "yes" or not



parseError
public void parseError(XMLElement parent, String message) throws InstallerException(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



readSpec
public void readSpec(String specFileName) throws Exception(Code)
Reads the XML specification given by the file name. The result is stored in spec.
exception:
  Exception - for any problems in reading the specification



readSpec
public void readSpec(String specFileName, VariableSubstitutor substitutor) throws Exception(Code)
Reads the XML specification given by the file name. The result is stored in spec.
exception:
  Exception - for any problems in reading the specification



readSpec
public void readSpec(InputStream input) throws Exception(Code)
Reads the XML specification given by the input stream. The result is stored in spec.
exception:
  Exception - for any problems in reading the specification



readSpec
public void readSpec(InputStream input, VariableSubstitutor substitutor) throws Exception(Code)
Reads the XML specification given by the input stream. The result is stored in spec.
exception:
  Exception - for any problems in reading the specification



setSpec
public void setSpec(XMLElement element)(Code)
Sets the specifaction to the given XML element.
Parameters:
  element -



substituteVariables
public InputStream substituteVariables(InputStream input, VariableSubstitutor substitutor) throws Exception(Code)
Creates an temp file in to the substitutor the substituted contents of input writes; close it and (re)open it as FileInputStream. The file will be deleted on exit.
Parameters:
  input - the opened input stream which contents should be substituted
Parameters:
  substitutor - substitutor which should substitute the contents of input a file input stream of the created temporary file
throws:
  Exception -



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.