org.modeshape.sequencer.ddl
Class DdlParsers
java.lang.Object
org.modeshape.sequencer.ddl.DdlParsers
@Immutable
public class DdlParsers
- extends Object
A set of parsers capable of understanding DDL file content. This class can be used directly to create an AstNode
tree
representing nodes and properties for DDL statement components.
You can also provide an input or parent AstNode
node as the starting point for your tree.
The parser is based on the SQL-92 and extended by specific dialects. These dialect-specific parsers provide db-specific parsing
of db-specific statements of statement extensions, features or properties.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUILTIN_PARSERS
public static final List<DdlParser> BUILTIN_PARSERS
DdlParsers
public DdlParsers()
- Create an instance that uses all of the
built-in parsers
.
DdlParsers
public DdlParsers(List<DdlParser> parsers)
- Create an instance that uses the supplied parsers, in order.
- Parameters:
parsers
- the list of parsers; may be empty or null if the built-in parsers
should be used
parse
public AstNode parse(String ddl,
String fileName)
throws ParsingException
- Parse the supplied DDL content and return the
root node
of the AST representation.
- Parameters:
ddl
- content string; may not be nullfileName
- the approximate name of the file containing the DDL content; may be null if this is not known
- Returns:
- the root tree
AstNode
- Throws:
ParsingException
- if there is an error parsing the supplied DDL content
Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.