我在xjc
中使用gradle
,如下所示:
task xjc(type: JavaExec) {
inputs.files(schemaDir)
outputs.dir(generatedSrcDir)
main = 'com.sun.tools.xjc.Driver'
classpath = configurations.xjc
jvmArgs '-Djavax.xml.accessExternalSchema=all'
args '-quiet',
'-d',
"$generatedSrcDir",
'-classpath',
"$configurations.xjc.asPath",
'-disableXmlSecurity',
'-extension',
'-npa',
'-no-header',
'-enableIntrospection',
'-Xxew',
'-Xxew:instantiate lazy',
'-Xcomments',
'-Xcomments-mode=replace',
'-Xequals',
'-Xhashcode',
'-Xtostring',
"$schemaDir",
'-b',
"$schemaDir"
doFirst {
// Create directory for generated sources if not exists
mkdir(generatedSrcDir)
println "Generating JAXB sources with XJC version $jaxbVersion ..."
}
}
我需要知道我是否可以用final
标记所有适合的课程?
P.S。这里final
的点是保留生成的类的等于合同。