Java2HTML Reconstruction Reconstruction (4)

zhaozj2021-02-17  71

Java2HTML Reconstruction Reconstruction (4)

It turns out that this is a method of judging the current parameters:

IF (o02.Length == 0 || O06 (new string [] {

"Help", "h", "?", "/?"

}))

{

System.out.println (O07.O08);

Return False;

}

This section is a help system. Since we have to modify, then the help system is handled. Just when we will definitely be completed successfully.

Target lock o07.O08 (this is a final static string):

Public O07 ()

{

}

Static

{

O0995 = System.getProperty ("line.separator");

IF (o0995 == null)

{

System.out.println ("Warning: System Property line.separator not defined / N");

O0995 = "/ r / n";

}

O0997 = "CopyRight (C) 2000-2003 Polygon Enterprises." O0995 "New version Available from http://www.java2html.com" o0995 "(Type J2h with no arguments to get help);

O08 = o0995 "USAGE: [J2H | Java J2H | java -jar j2h.jar] [options]"

O0995 "-d Destination Output Directory"

O0995 "-JS java source directory"

O0995 "-jd [web_reference] javadoc source directory"

O0995 "-m Margin Size (with line number)"

O0995 "-t tab size"

O0995 "-N Title Name"

O0995 "-nh prevents the header from being displayed"

O0995 "-NF prevents the footer from being displayed"

// I have added an Encoding help information here.

O0995 "- Encoding set the html /" charset / ""

O0995 "-S Simple Output, Just Include the Java Source and Stylesheet.css Files"

O0995 "- H (or no arguments) this help" o0995

O0995 "Edit generated styleteet.css file to change colors" o0995 "View generated index.html in browser to see results after running"

O0995;

}

Now use Java2HTML, there is already a help information for Encoding.

String as2 [] = O010 (New String [] {"Javasource", "JS"}, false, -1);

After helping information, we saw that this method is called, it seems that this is the method of judging the contents of the parameters.

Private string [] O010 (String as [], Boolean Flag, INT i)

Throws BadOptionException

{

INT j = 0;

INT K = 0;

Vector vector = new vector ();

For (; j

{

For (int L = 0; l

{

IF (! o02 [j] .equalsignorecase ("-" as [l])))

{

CONTINUE;

}

O03 [J] = True;

J ;

IF (k == i)

{

Throw new badoptionException (as [0] "Should Only Be set" "TIME (S)");

}

IF (j> = o02.length)

{

Throw New BadoptionException ("Value Not Set for" AS [0]);

}

O03 [J] = True;

Vector.addelement (O02 [J]);

K ;

Break;

}

}

IF (Flag && K == 0)

{

Throw new badoptionException (as [0] "Needs to be set");

Else

{

RETURN O026 (Vector);

}

}

It turns out that this method is to compare the parameters (AS) and Java2HTML default parameters sent by the user. If it is the parameter of Java2HTML, the user's parameters are valued.

Let's add our parameters first.

// Add our custom parameters

String as3 [] = o010 (new string "

"eNCoding", "encoding"

}, false, -1);

// Similarly, 依 葫 画 画 画

IF (as3.length> 0)

{

Java2html.setencoding (AS3 [0]);

}

This way, the user's parameters are sent to AS [].

But now there is no setEncoding method in java2html. We add one.

Go back to Java2html.java Add:

/ / I set the default character encoding here because UTF-8 basically supports all character encodes.

Private string encoding = "UTF-8";

// Add a new method

Public void setEncoding (string strencoding) {

Encoding = streencoding;

}

In this way, the user's parameters have been sent to the Java2HTML class.

I want to know how the matter is, and I listen to the decomposition.

转载请注明原文地址:https://www.9cbs.com/read-31159.html

New Post(0)