Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swifteditor_java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fukai
swifteditor_java
Commits
6f711639
Commit
6f711639
authored
Jun 08, 2021
by
fukai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合535
parent
b8458038
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
swift_pattern_2018.xlsx
src/main/resources/swift_pattern_2018.xlsx
+0
-0
SwitfMessagePattern.java
...t/java/com/brilliace/swifteditor/SwitfMessagePattern.java
+20
-6
No files found.
src/main/resources/swift_pattern_2018.xlsx
View file @
6f711639
No preview for this file type
src/test/java/com/brilliace/swifteditor/SwitfMessagePattern.java
View file @
6f711639
...
@@ -3,24 +3,38 @@ package com.brilliace.swifteditor;
...
@@ -3,24 +3,38 @@ package com.brilliace.swifteditor;
import
com.brilliace.swifteditor.tag.message.MessageFormat
;
import
com.brilliace.swifteditor.tag.message.MessageFormat
;
import
com.brilliace.swifteditor.tag.message.SWFMessage
;
import
com.brilliace.swifteditor.tag.message.SWFMessage
;
import
junit.framework.TestCase
;
import
junit.framework.TestCase
;
import
org.apache.commons.io.IOUtils
;
import
java.io.*
;
public
class
SwitfMessagePattern
extends
TestCase
{
public
class
SwitfMessagePattern
extends
TestCase
{
private
void
genPattern
(
String
mty
)
private
void
genPattern
(
String
mty
)
throws
IOException
{
{
SWFMessage
swfMessage
=
MessageFormat
.
getSWFMessage
(
mty
);
SWFMessage
swfMessage
=
MessageFormat
.
getSWFMessage
(
mty
);
String
json
=
swfMessage
.
toFormatJSON
();
String
json
=
swfMessage
.
toFormatJSON
();
System
.
out
.
println
(
"--------------------------------"
);
System
.
out
.
println
(
"--------------------------------"
);
json
=
"const Tags = "
+
json
+
"\r\n\r\n"
+
"const Title = \""
+
swfMessage
.
getName
()+
"\"\r\n\r\n"
;
json
=
json
+
"export default { Tags,Title}"
;
System
.
out
.
println
(
json
);
System
.
out
.
println
(
json
);
File
targetJs
=
new
File
(
"d:/SwiftMT"
);
if
(!
targetJs
.
exists
())
targetJs
.
mkdirs
();
targetJs
=
new
File
(
targetJs
,
"MT"
+
mty
+
".js"
);
if
(!
targetJs
.
exists
())
targetJs
.
createNewFile
();
FileWriter
writer
=
new
FileWriter
(
targetJs
);
IOUtils
.
write
(
json
,
writer
);
IOUtils
.
closeQuietly
(
writer
);
}
}
public
void
testGen202
()
public
void
testGen202
()
throws
IOException
{
{
genPattern
(
"202"
);
genPattern
(
"202"
);
}
}
public
void
testGen103
()
public
void
testGen103
()
throws
IOException
{
{
genPattern
(
"103"
);
genPattern
(
"103"
);
}
}
public
void
testGen566
()
throws
IOException
{
genPattern
(
"535"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment