FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java/src/main/java/com/jsoniter/StaticCodeGenerator.java at master · Howeu/java · GitHub
Howeu
/
java
Public
forked from
json-iterator/java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java
/
src
/
main
/
java
/
com
/
jsoniter
/
StaticCodeGenerator.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 1.04 KB
Breadcrumbs
java
/
src
/
main
/
java
/
com
/
jsoniter
/
StaticCodeGenerator.java
Copy path
File metadata and controls
25 lines (22 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package
com
.
jsoniter
;
import
com
.
jsoniter
.
output
.
EncodingMode
;
import
com
.
jsoniter
.
output
.
JsonStream
;
import
com
.
jsoniter
.
spi
.
CodegenConfig
;
import
com
.
jsoniter
.
spi
.
JsonException
;
import
java
.
io
.
File
;
public
class
StaticCodeGenerator
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
configClassName
=
args
[
0
];
String
configJavaFile
=
configClassName
.
replace
(
'.'
,
'/'
) +
".java"
;
if
(!
new
File
(
configJavaFile
).
exists
()) {
throw
new
JsonException
(
"must execute static code generator in the java source code directory which contains: "
+
configJavaFile
);
}
Class
<?>
clazz
=
Class
.
forName
(
configClassName
);
CodegenConfig
config
= (
CodegenConfig
)
clazz
.
newInstance
();
JsonIterator
.
setMode
(
DecodingMode
.
DYNAMIC_MODE_AND_MATCH_FIELD_WITH_HASH
);
JsonStream
.
setMode
(
EncodingMode
.
DYNAMIC_MODE
);
config
.
setup
();
CodegenAccess
.
staticGenDecoders
(
config
.
whatToCodegen
());
com
.
jsoniter
.
output
.
CodegenAccess
.
staticGenEncoders
(
config
.
whatToCodegen
());
}
}
Back
|
FazBrowse Home
|
New Git URL