Interface IDOMFactory

All Known Implementing Classes:
DOMFactory

public interface IDOMFactory
Deprecated.
The JDOM was made obsolete by the addition in 2.0 of the more powerful, fine-grained DOM/AST API found in the org.eclipse.jdt.core.dom package.
A factory used to create document fragment (DF) nodes. An IDOMCompilationUnit represents the root of a complete JDOM (that is, a source file with one of the Java-like extensions). Other node types represent fragments of a compilation unit.

The factory can be used to create empty DFs or it can create DFs from source strings. All DFs created empty are assigned default values as required, such that a call to IDOMNode.getContents will generate a valid source string. See individual create methods for details on the default values supplied. The factory does its best to recognize Java structures in the source provided. If the factory is completely unable to recognize source constructs, the factory method returns null.

Even if a DF is created successfully from source code, it does not guarantee that the source code will compile error free. Similarly, the contents of a DF are not guaranteed to compile error free. However, syntactically correct source code is guaranteed to be recognized and successfully generate a DF. Similarly, if all of the fragments of a JDOM are syntactically correct, the contents of the entire document will be correct too.

The factory does not perform or provide any code formatting. Document fragments created on source strings must be pre-formatted. The JDOM attempts to maintain the formatting of documents as best as possible. For this reason, document fragments created for nodes that are to be strung together should end with a new-line character. Failing to do so will result in a document that has elements strung together on the same line. This is especially important if a source string ends with a // comment. In this case, it would be syntactically incorrect to omit the new line character.

See Also: