Package org.eclipse.jdt.core.jdom
Class DOMFactory
- java.lang.Object
-
- org.eclipse.jdt.core.jdom.DOMFactory
-
- All Implemented Interfaces:
IDOMFactory
public class DOMFactory extends Object implements 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.Standard implementation ofIDOMFactory, and the only means of creating JDOMs and document fragments.This class may be instantiated.
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Constructor Description DOMFactory()Deprecated.Creates a new DOM factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IDOMTypecreateClass()Deprecated.Creates a default type document fragment.IDOMCompilationUnitcreateCompilationUnit()Deprecated.Creates and return an empty JDOM.IDOMCompilationUnitcreateCompilationUnit(char[] sourceCode, String name)Deprecated.Creates a JDOM on the given source code.IDOMCompilationUnitcreateCompilationUnit(String sourceCode, String name)Deprecated.Creates a JDOM on the given source code.IDOMFieldcreateField()Deprecated.Creates a default field document fragment.IDOMFieldcreateField(String sourceCode)Deprecated.Creates a field document fragment on the given source code.IDOMImportcreateImport()Deprecated.Creates an empty import document fragment.IDOMImportcreateImport(String sourceCode)Deprecated.Creates an import document fragment on the given source code.IDOMInitializercreateInitializer()Deprecated.Creates an empty initializer document fragment.IDOMInitializercreateInitializer(String sourceCode)Deprecated.Creates an initializer document fragment from the given source code.IDOMTypecreateInterface()Deprecated.Creates a default type document fragment.IDOMMethodcreateMethod()Deprecated.Creates a default method document fragment.IDOMMethodcreateMethod(String sourceCode)Deprecated.Creates a method document fragment on the given source code.IDOMPackagecreatePackage()Deprecated.Creates an empty package document fragment.IDOMPackagecreatePackage(String sourceCode)Deprecated.Creates a package document fragment on the given source code.IDOMTypecreateType()Deprecated.Creates a default type document fragment.IDOMTypecreateType(String sourceCode)Deprecated.Creates a type document fragment on the given source code.
-
-
-
Method Detail
-
createCompilationUnit
public IDOMCompilationUnit createCompilationUnit()
Deprecated.Description copied from interface:IDOMFactoryCreates and return an empty JDOM. The initial content is an empty string.- Specified by:
createCompilationUnitin interfaceIDOMFactory- Returns:
- the new compilation unit
-
createCompilationUnit
public IDOMCompilationUnit createCompilationUnit(char[] sourceCode, String name)
Deprecated.Description copied from interface:IDOMFactoryCreates a JDOM on the given source code. The syntax for the given source code corresponds to CompilationUnit (JLS2 7.3).- Specified by:
createCompilationUnitin interfaceIDOMFactory- Parameters:
sourceCode- the source code character array, ornullname- the name of the compilation unit- Returns:
- the new compilation unit, or
nullif unable to recognize the source code, or if the source code isnull
-
createCompilationUnit
public IDOMCompilationUnit createCompilationUnit(String sourceCode, String name)
Deprecated.Description copied from interface:IDOMFactoryCreates a JDOM on the given source code. The syntax for the given source code corresponds to CompilationUnit (JLS2 7.3).- Specified by:
createCompilationUnitin interfaceIDOMFactory- Parameters:
sourceCode- the source code string, ornullname- the name of the compilation unit- Returns:
- the new compilation unit, or
nullif unable to recognize the source code, or if the source code isnull
-
createField
public IDOMField createField()
Deprecated.Description copied from interface:IDOMFactoryCreates a default field document fragment. Initially the field will have default protection, type"Object", name"aField", no comment, and no initializer.- Specified by:
createFieldin interfaceIDOMFactory- Returns:
- the new field
-
createField
public IDOMField createField(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates a field document fragment on the given source code. The given source string corresponds to FieldDeclaration (JLS2 8.3) and ConstantDeclaration (JLS2 9.3) restricted to a single VariableDeclarator clause.- Specified by:
createFieldin interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new field, or
nullif unable to recognize the source code, if the source code isnull, or when the source contains more than one VariableDeclarator clause
-
createImport
public IDOMImport createImport()
Deprecated.Description copied from interface:IDOMFactoryCreates an empty import document fragment. Initially the import will have name"java.lang.*"and be non-static.- Specified by:
createImportin interfaceIDOMFactory- Returns:
- the new import
-
createImport
public IDOMImport createImport(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates an import document fragment on the given source code. The syntax for the given source string corresponds to ImportDeclaration (JLS2 7.5).- Specified by:
createImportin interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new import, or
nullif unable to recognize the source code, or if the source code isnull
-
createInitializer
public IDOMInitializer createInitializer()
Deprecated.Description copied from interface:IDOMFactoryCreates an empty initializer document fragment. Initially the initializer will be static and have no body or comment.- Specified by:
createInitializerin interfaceIDOMFactory- Returns:
- the new initializer
-
createInitializer
public IDOMInitializer createInitializer(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates an initializer document fragment from the given source code. The syntax for the given source string corresponds to InstanceInitializer (JLS2 8.6) and StaticDeclaration (JLS2 8.7).- Specified by:
createInitializerin interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new initializer, or
nullif unable to recognize the source code, or if the source code isnull
-
createMethod
public IDOMMethod createMethod()
Deprecated.Description copied from interface:IDOMFactoryCreates a default method document fragment. Initially the method will have public visibility, return type"void", be named"newMethod", have no parameters, no comment, and an empty body.- Specified by:
createMethodin interfaceIDOMFactory- Returns:
- the new method
-
createMethod
public IDOMMethod createMethod(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates a method document fragment on the given source code. The syntax for the given source string corresponds to MethodDeclaration (JLS2 8.4), ConstructorDeclaration (JLS2 8.8), and AbstractMethodDeclaration (JLS2 9.4).- Specified by:
createMethodin interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new method, or
nullif unable to recognize the source code, or if the source code isnull
-
createPackage
public IDOMPackage createPackage()
Deprecated.Description copied from interface:IDOMFactoryCreates an empty package document fragment. Initially the package declaration will have no name.- Specified by:
createPackagein interfaceIDOMFactory- Returns:
- the new package
-
createPackage
public IDOMPackage createPackage(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates a package document fragment on the given source code. The syntax for the given source string corresponds to PackageDeclaration (JLS2 7.4).- Specified by:
createPackagein interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new package, or
nullif unable to recognize the source code, or if the source code isnull
-
createType
public IDOMType createType()
Deprecated.Description copied from interface:IDOMFactoryCreates a default type document fragment. Initially the type will be a public class named"AClass", with no members or comment.- Specified by:
createTypein interfaceIDOMFactory- Returns:
- the new type
-
createClass
public IDOMType createClass()
Deprecated.Description copied from interface:IDOMFactoryCreates a default type document fragment. Initially the type will be a public class named"AClass", with no members or comment.- Specified by:
createClassin interfaceIDOMFactory- Returns:
- the new class
-
createInterface
public IDOMType createInterface()
Deprecated.Description copied from interface:IDOMFactoryCreates a default type document fragment. Initially the type will be a public interface named"AnInterface", with no members or comment.- Specified by:
createInterfacein interfaceIDOMFactory- Returns:
- the new interface
-
createType
public IDOMType createType(String sourceCode)
Deprecated.Description copied from interface:IDOMFactoryCreates a type document fragment on the given source code. The syntax for the given source string corresponds to ClassDeclaration (JLS2 8.1) and InterfaceDeclaration (JLS2 9.1).- Specified by:
createTypein interfaceIDOMFactory- Parameters:
sourceCode- the source code- Returns:
- the new type, or
nullif unable to recognize the source code, or if the source code isnull
-
-