View Javadoc
1   package org.codehaus.mojo.natives.javah;
2   
3   /*
4    * The MIT License
5    * 
6    * Copyright (c) 2004, The Codehaus
7    * 
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
9    * associated documentation files (the "Software"), to deal in the Software without restriction,
10   * including without limitation the rights to use, copy, modify, merge, publish, distribute,
11   * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
12   * furnished to do so, subject to the following conditions:
13   * 
14   * The above copyright notice and this permission notice shall be included in all copies or
15   * substantial portions of the Software.
16   * 
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
18   * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22   */
23  
24  import java.io.File;
25  
26  public class JavahConfiguration
27  {
28      /**
29       * Working directory where javah command will run
30       */
31      private File workingDirectory;
32  
33      /**
34       * Directory to save generate files, must either be fullpath or relative to relative workingDirectory
35       */
36      private File outputDirectory;
37  
38      /**
39       * Option to combine all generated include files into one file ${outputDirectory}/${fileName} Support javah -o
40       * option
41       */
42      private String fileName;
43  
44      /**
45       * Location for the actual binary. This may be <code>nulL</code>
46       */
47      private File javahPath;
48  
49      /*
50       * the fully-qualified class name
51       */
52      private String[] classNames;
53  
54      /**
55       * ClassPaths to locate classNames
56       */
57      private String[] classPaths;
58  
59      private boolean useEnvClasspath = false;
60  
61      private boolean verbose = false;
62  
63      public void setOutputDirectory( File dir )
64      {
65          this.outputDirectory = dir;
66      }
67  
68      public File getOutputDirectory()
69      {
70          return this.outputDirectory;
71      }
72  
73      public String[] getClassPaths()
74      {
75          return this.classPaths;
76      }
77  
78      public void setJavahPath( File javahPath )
79      {
80          this.javahPath = javahPath;
81      }
82  
83      public void setClassPaths( String[] paths )
84      {
85          this.classPaths = paths;
86      }
87  
88      public void setUseEnvClasspath( boolean flag )
89      {
90          this.useEnvClasspath = flag;
91      }
92  
93      public boolean getUseEnvClasspath()
94      {
95          return this.useEnvClasspath;
96      }
97  
98      public void setVerbose( boolean flag )
99      {
100         this.verbose = flag;
101     }
102 
103     public File getJavahPath()
104     {
105         return this.javahPath;
106     }
107 
108     public boolean getVerbose()
109     {
110         return this.verbose;
111     }
112 
113     public void setClassNames( String[] names )
114     {
115         this.classNames = names;
116     }
117 
118     public String[] getClassNames()
119     {
120         return this.classNames;
121     }
122 
123     public void setFileName( String name )
124     {
125         this.fileName = name;
126     }
127 
128     public String getFileName()
129     {
130         return this.fileName;
131     }
132 
133     public File getWorkingDirectory()
134     {
135         return this.workingDirectory;
136     }
137 
138     public void setWorkingDirectory( File dir )
139     {
140         this.workingDirectory = dir;
141     }
142 }