luehe 2003/03/06 11:42:54
Modified: jasper2/src/share/org/apache/jasper JspC.java
Log:
Made setArgs method public
Revision Changes Path
1.36 +84 -84
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- JspC.java 27 Feb 2003 22:51:38 -0000 1.35
+++ JspC.java 6 Mar 2003 19:42:54 -0000 1.36
@@ -209,6 +209,87 @@
private boolean listErrors = false;
private boolean showSuccess = false;
+ public void setArgs(String[] arg) {
+ args = arg;
+ String tok;
+
+ dieLevel = NO_DIE_LEVEL;
+ die = dieLevel;
+
+ while ((tok = nextArg()) != null) {
+ if (tok.equals(SWITCH_VERBOSE)) {
+ verbose = true;
+ showSuccess = true;
+ listErrors = true;
+ } else if (tok.equals(SWITCH_OUTPUT_DIR)) {
+ tok = nextArg();
+ setOutputDir( tok );
+ } else if (tok.equals(SWITCH_OUTPUT_SIMPLE_DIR)) {
+ tok = nextArg();
+ if (tok != null) {
+ scratchDir = new File(new File(tok).getAbsolutePath());
+ dirset = false;
+ } else {
+ // either an in-java call with an explicit null
+ // or a "-d --" sequence should cause this,
+ // which would mean default handling
+ /* no-op */
+ scratchDir = null;
+ }
+ } else if (tok.equals(SWITCH_PACKAGE_NAME)) {
+ targetPackage = nextArg();
+ } else if (tok.equals(SWITCH_COMPILE)) {
+ compile=true;
+ } else if (tok.equals(SWITCH_CLASS_NAME)) {
+ targetClassName = nextArg();
+ } else if (tok.equals(SWITCH_URI_BASE)) {
+ uriBase=nextArg();
+ } else if (tok.equals(SWITCH_URI_ROOT)) {
+ setUriroot( nextArg());
+ } else if (tok.equals(SWITCH_FILE_WEBAPP)) {
+ setUriroot( nextArg());
+ } else if ( tok.equals( SHOW_SUCCESS ) ) {
+ showSuccess = true;
+ } else if ( tok.equals( LIST_ERRORS ) ) {
+ listErrors = true;
+ } else if (tok.equals(SWITCH_WEBAPP_INC)) {
+ webxmlFile = nextArg();
+ if (webxmlFile != null) {
+ webxmlLevel = INC_WEBXML;
+ }
+ } else if (tok.equals(SWITCH_WEBAPP_XML)) {
+ webxmlFile = nextArg();
+ if (webxmlFile != null) {
+ webxmlLevel = ALL_WEBXML;
+ }
+ } else if (tok.equals(SWITCH_MAPPED)) {
+ mappedFile = true;
+ } else if (tok.startsWith(SWITCH_DIE)) {
+ try {
+ dieLevel = Integer.parseInt(
+ tok.substring(SWITCH_DIE.length()));
+ } catch (NumberFormatException nfe) {
+ dieLevel = DEFAULT_DIE_LEVEL;
+ }
+ die = dieLevel;
+ } else {
+ //pushBackArg();
+ if (!fullstop) {
+ argPos--;
+ }
+ // Not a recognized Option? Start treting them as JSP Pages
+ break;
+ }
+ }
+
+ // Add all extra arguments to the list of files
+ while( true ) {
+ String file = nextFile();
+ if( file==null ) break;
+ pages.addElement( file );
+ }
+ }
+
public boolean getKeepGenerated() {
// isn't this why we are running jspc?
return true;
@@ -870,87 +951,6 @@
return null;
} else {
return args[argPos++];
- }
- }
-
- void setArgs(String[] arg) {
- args = arg;
- String tok;
-
- dieLevel = NO_DIE_LEVEL;
- die = dieLevel;
-
- while ((tok = nextArg()) != null) {
- if (tok.equals(SWITCH_VERBOSE)) {
- verbose = true;
- showSuccess = true;
- listErrors = true;
- } else if (tok.equals(SWITCH_OUTPUT_DIR)) {
- tok = nextArg();
- setOutputDir( tok );
- } else if (tok.equals(SWITCH_OUTPUT_SIMPLE_DIR)) {
- tok = nextArg();
- if (tok != null) {
- scratchDir = new File(new File(tok).getAbsolutePath());
- dirset = false;
- } else {
- // either an in-java call with an explicit null
- // or a "-d --" sequence should cause this,
- // which would mean default handling
- /* no-op */
- scratchDir = null;
- }
- } else if (tok.equals(SWITCH_PACKAGE_NAME)) {
- targetPackage = nextArg();
- } else if (tok.equals(SWITCH_COMPILE)) {
- compile=true;
- } else if (tok.equals(SWITCH_CLASS_NAME)) {
- targetClassName = nextArg();
- } else if (tok.equals(SWITCH_URI_BASE)) {
- uriBase=nextArg();
- } else if (tok.equals(SWITCH_URI_ROOT)) {
- setUriroot( nextArg());
- } else if (tok.equals(SWITCH_FILE_WEBAPP)) {
- setUriroot( nextArg());
- } else if ( tok.equals( SHOW_SUCCESS ) ) {
- showSuccess = true;
- } else if ( tok.equals( LIST_ERRORS ) ) {
- listErrors = true;
- } else if (tok.equals(SWITCH_WEBAPP_INC)) {
- webxmlFile = nextArg();
- if (webxmlFile != null) {
- webxmlLevel = INC_WEBXML;
- }
- } else if (tok.equals(SWITCH_WEBAPP_XML)) {
- webxmlFile = nextArg();
- if (webxmlFile != null) {
- webxmlLevel = ALL_WEBXML;
- }
- } else if (tok.equals(SWITCH_MAPPED)) {
- mappedFile = true;
- } else if (tok.startsWith(SWITCH_DIE)) {
- try {
- dieLevel = Integer.parseInt(
- tok.substring(SWITCH_DIE.length()));
- } catch (NumberFormatException nfe) {
- dieLevel = DEFAULT_DIE_LEVEL;
- }
- die = dieLevel;
- } else {
- //pushBackArg();
- if (!fullstop) {
- argPos--;
- }
- // Not a recognized Option? Start treting them as JSP Pages
- break;
- }
- }
-
- // Add all extra arguments to the list of files
- while( true ) {
- String file = nextFile();
- if( file==null ) break;
- pages.addElement( file );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]