Friday, April 11, 2014

Generate Java objects from DTD or XML

On  Jdk installed machine use this following Command  to generate java classes.

1.    Create a folder.  (say Test is the folder).

2.    Copy the DTD file in the location.

3.    On command prompt use the command

xjc -dtd -d com –p [Package structure] [Dtd file name with .dtd extention]

Java classes will be created inside test folder with the specified package structure.

No comments:

private methods on Interface

  Private methods can be used on interface from java 9.   This will help in     Avoiding code duplication.     Ensuring code re-usab...