时间:2021-05-19
平时喜欢根据写一个xjc批处理命令,根据xsd批量生成java类,觉得很方便也很酷。但是有时候xsd生成的java类中含有汉字,结果总是有些问题。
可是xjc命令参数又没有encoding参数之类的。在网上搜了一通,忽然发现了一个好东东:xjc是由com.sun.tools.internal.xjc.Driver实现的,因此
批处理命令可以如下:
java -Dfile.encoding=UTF-8 -cp D:\java\jdk1.6.0_03\lib\tools.jar com.sun.tools.internal.xjc.Driver -p com.geostar.csw.domain.layer metadata_geo_Layer.xsd
结果:
复制代码 代码如下:
parsing a schema...
compiling a schema...
com\geostar\csw\domain\layer\AbstractMDContentInformationType.java
com\geostar\csw\domain\layer\AbstractMDIdentificationType.java
com\geostar\csw\domain\layer\AbstractMDSpatialRepresentationType.java
com\geostar\csw\domain\layer\CIAddressType.java
com\geostar\csw\domain\layer\CICitationType.java
com\geostar\csw\domain\layer\CIContactType.java
com\geostar\csw\domain\layer\CIDateType.java
com\geostar\csw\domain\layer\CIDateTypeCode.java
com\geostar\csw\domain\layer\CIOnLineFunctionCode.java
com\geostar\csw\domain\layer\CIOnLineResourceType.java
com\geostar\csw\domain\layer\CIResponsiblePartyType.java
com\geostar\csw\domain\layer\CIRoleCode.java
com\geostar\csw\domain\layer\DQDataLineageType.java
com\geostar\csw\domain\layer\DQDataQualityType.java
com\geostar\csw\domain\layer\DQDqReportType.java
com\geostar\csw\domain\layer\DQDqStatementType.java
com\geostar\csw\domain\layer\DQSourceType.java
com\geostar\csw\domain\layer\DSAssociationTypeCode.java
com\geostar\csw\domain\layer\EXBoundingCoordinatesType.java
com\geostar\csw\domain\layer\EXExtentType.java
com\geostar\csw\domain\layer\EXGeographicBoundingBoxType.java
com\geostar\csw\domain\layer\EXGeographicBoundingPolygonType.java
com\geostar\csw\domain\layer\EXGeographicDescriptionType.java
com\geostar\csw\domain\layer\EXGeographicExtentPropertyType.java
com\geostar\csw\domain\layer\EXGeographicExtentType.java
com\geostar\csw\domain\layer\EXTemporalExtentPropertyType.java
com\geostar\csw\domain\layer\EXTemporalExtentType.java
com\geostar\csw\domain\layer\EXVerticalExtentType.java
com\geostar\csw\domain\layer\FBZY.java
com\geostar\csw\domain\layer\JHDA.java
com\geostar\csw\domain\layer\MDAerialImageIdentificationType.java
com\geostar\csw\domain\layer\MDAggregateInfomationPropertyType.java
com\geostar\csw\domain\layer\MDAggregateInfomationType.java
com\geostar\csw\domain\layer\MDAnalogMapIdentificationType.java
com\geostar\csw\domain\layer\MDApprovedTypeCode.java
com\geostar\csw\domain\layer\MDArchiveIdentificationType.java
com\geostar\csw\domain\layer\MDBrowseGraphicType.java
com\geostar\csw\domain\layer\MDCRSType.java
com\geostar\csw\domain\layer\MDCharacterSetCode.java
com\geostar\csw\domain\layer\MDClassificationCode.java
com\geostar\csw\domain\layer\MDConstraintsPropertyType.java
com\geostar\csw\domain\layer\MDContentInformationPropertyType.java
com\geostar\csw\domain\layer\MDCoverageContentTypeCode.java
com\geostar\csw\domain\layer\MDCoverageDescriptionType.java
com\geostar\csw\domain\layer\MDDataIdentificationType.java
com\geostar\csw\domain\layer\MDDescKeys.java
com\geostar\csw\domain\layer\MDDigitalArchiveIdentificationType.java
com\geostar\csw\domain\layer\MDDistributionType.java
com\geostar\csw\domain\layer\MDDistributorType.java
com\geostar\csw\domain\layer\MDEllipsoidParametersType.java
com\geostar\csw\domain\layer\MDFeatureCatalogueDescriptionType.java
com\geostar\csw\domain\layer\MDFormatType.java
com\geostar\csw\domain\layer\MDGeometricObjectTypeCode.java
com\geostar\csw\domain\layer\MDGovNameTypeBak.java
com\geostar\csw\domain\layer\MDGridSpatialRepresentationType.java
com\geostar\csw\domain\layer\MDIdentificationPropertyType.java
com\geostar\csw\domain\layer\MDIdentifierType.java
com\geostar\csw\domain\layer\MDImageDescriptionType.java
com\geostar\csw\domain\layer\MDImageIdentificationType.java
com\geostar\csw\domain\layer\MDImagingConditionCode.java
com\geostar\csw\domain\layer\MDLegConstsType.java
com\geostar\csw\domain\layer\MDMaintInformationType.java
com\geostar\csw\domain\layer\MDMaintenanceFrequencyCode.java
com\geostar\csw\domain\layer\MDMapFormCode.java
com\geostar\csw\domain\layer\MDMetadataType.java
com\geostar\csw\domain\layer\MDProgressCode.java
com\geostar\csw\domain\layer\MDProjectionParametersType.java
com\geostar\csw\domain\layer\MDReferenceSystemType.java
com\geostar\csw\domain\layer\MDReferencedThemeType.java
com\geostar\csw\domain\layer\MDResolutionType.java
com\geostar\csw\domain\layer\MDResourceTypeCode.java
com\geostar\csw\domain\layer\MDRestrictionCode.java
com\geostar\csw\domain\layer\MDRestrictionCodeEx.java
com\geostar\csw\domain\layer\MDScopeCode.java
com\geostar\csw\domain\layer\MDSecurityConstraintsType.java
com\geostar\csw\domain\layer\MDSpatialRepresentationPropertyType.java
com\geostar\csw\domain\layer\MDSpatialRepresentationTypeCode.java
com\geostar\csw\domain\layer\MDTopicCategoryCode.java
com\geostar\csw\domain\layer\MDTopoLogyLevelCode.java
com\geostar\csw\domain\layer\MDTpCatType.java
com\geostar\csw\domain\layer\MDVectorSpatialRepresentationType.java
com\geostar\csw\domain\layer\ObjectFactory.java
com\geostar\csw\domain\layer\SVOperationMetadataType.java
com\geostar\csw\domain\layer\SVServiceIdentificationType.java
com\geostar\csw\domain\layer\SpatialReferenceInfo.java
com\geostar\csw\domain\layer\TBOOL.java
com\geostar\csw\domain\layer\TDYTABLETYPE.java
com\geostar\csw\domain\layer\TDataInfo.java
com\geostar\csw\domain\layer\TJHSJ.java
com\geostar\csw\domain\layer\TJHTYPE.java
com\geostar\csw\domain\layer\TJHXX.java
com\geostar\csw\domain\layer\TLAYERTYPE.java
com\geostar\csw\domain\layer\TMInstantType.java
com\geostar\csw\domain\layer\TMPeriodType.java
com\geostar\csw\domain\layer\TMetaInfo.java
com\geostar\csw\domain\layer\TMetaTotal.java
com\geostar\csw\domain\layer\TTABLETYPE.java
com\geostar\csw\domain\layer\TTHMEATICTYPE.java
com\geostar\csw\domain\layer\TUPDATETYPE.java
com\geostar\csw\domain\layer\TUserInfo.java
com\geostar\csw\domain\layer\TVersionInfo.java
com\geostar\csw\domain\layer\TZDGL.java
com\geostar\csw\domain\layer\TZDJH.java
com\geostar\csw\domain\layer\UpdateDescribe.java
com\geostar\csw\domain\layer\package-info.java
c:\Catalog实体类生成工具>
忽然感觉好兴奋!jaxb真的是好东东!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文实例讲述了Jaxb2实现JavaBean与xml互转的方法。分享给大家供大家参考,具体如下:一、简介JAXB(JavaArchitectureforXMLB
在淘宝开店了以后,肯定少不了商品,这个是一般都会去填写商品的编码,有网友就问了,淘宝上架宝贝商家编码是通用吗?下面就这个问题来为大家做详细的介绍,希望对您会
前言ajax相信不用过多介绍了,作者坚信可以用配置解决的问题,请勿硬编码,下面话不多说了,来一看看详细的介绍吧。姊妹篇jQuery进阶:用最优雅的方式写ajax
这篇文章主要介绍了Python3的unicode编码转换成中文的问题及解决方案,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要
本篇介绍下JAXB进阶使用,命名空间处理使用package-info.java添加默认命名空间在需要添加命名空间的包下面添加package-info.java文