org.jboss.shrinkwrap.descriptor.metadata
Class MetadataParser

java.lang.Object
  extended by org.jboss.shrinkwrap.descriptor.metadata.MetadataParser

public class MetadataParser
extends Object

This class is the entry point for parsing either xsd or dtd files, and based on the extracted metadata information, the class is also able to produce Shrinkdesc API and implementation source code. is parsed.

The class will start a DTD parsing when the files are ending with '.dtd'. Otherwise, the files are considered as XSD's.

Author:
Ralf Battenfeld

Constructor Summary
MetadataParser()
           
 
Method Summary
 void generateCode(MetadataParserPath path)
          Generates source code by applying the ddJavaAll.xsl XSLT extracted from the resource stream.
 Metadata getMetadata()
           
 String getPathToMetadataFile()
          Returns the path and name of the generated metadata xml file, if configured to produce it and the parse method is executed successfully.
 void parse(MetadataParserPath path, List<?> confList, boolean verbose)
          Parses one or more XSD schemas or DTD and produces java classes based on the parsing results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataParser

public MetadataParser()
Method Detail

getMetadata

public Metadata getMetadata()

parse

public void parse(MetadataParserPath path,
                  List<?> confList,
                  boolean verbose)
           throws Exception
Parses one or more XSD schemas or DTD and produces java classes based on the parsing results.

Parameters:
path - specifies where to create the interface, implementation and test case java classes.
confList - list MetadataParserConfiguration objects.
verbose - if true, additional parsing information are printed out, otherwise not.
Throws:
Exception

generateCode

public void generateCode(MetadataParserPath path)
                  throws TransformerException
Generates source code by applying the ddJavaAll.xsl XSLT extracted from the resource stream.

Throws:
TransformerException

getPathToMetadataFile

public String getPathToMetadataFile()
Returns the path and name of the generated metadata xml file, if configured to produce it and the parse method is executed successfully.

Returns:
full path of the generated metadata XML file.


Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.