Top Description Constructors Methods
org.jdom2

public Class DefaultJDOMFactory

extends Object
implements JDOMFactory
Class Inheritance
All Implemented Interfaces
org.jdom2.JDOMFactory
Known Direct Subclasses
org.jdom2.SlimJDOMFactory, org.jdom2.UncheckedJDOMFactory, org.jdom2.located.LocatedJDOMFactory
Imports
java.util.*

Creates the standard top-level JDOM classes (Element, Document, Comment, etc). A subclass of this factory might construct custom classes.
Authors
Ken Rune Holland, Phil Nelson, Bradley S. Huffman, Rolf Lear

Constructor Summary

AccessConstructor and Description
public
DefaultJDOMFactory()

Creates a new DefaultJDOMFactory instance.

Method Summary

Modifier and TypeMethod and Description
public void
addContent(Parent
The Parent to add the content to.
parent
,
Content
The Content to add
child
)

Implements org.jdom2.JDOMFactory.addContent.

This will add the specified content to the specified parent instance
public void
addNamespaceDeclaration(Element
The Element to add the Namespace to
parent
,
Namespace
The Namespace to add.
additional
)

Implements org.jdom2.JDOMFactory.addNamespaceDeclaration.

Adds a namespace declaration to an Element
public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
,
Namespace
Namespace of the new Attribute
namespace
)

Implements org.jdom2.JDOMFactory.attribute.

This will create a new Attribute with the specified (local) name and value, and in the provided org.jdom2.Namespace.

public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
,
int
int type for new attribute.
type
,
Namespace
Namespace namespace for new attribute.
namespace
)

Implements org.jdom2.JDOMFactory.attribute.

Deprecated
This will create a new Attribute with the specified (local) name, value, and type, and in the provided org.jdom2.Namespace.
public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
,
AttributeType
AttributeType type for new attribute.
type
,
Namespace
Namespace namespace for new attribute.
namespace
)

Implements org.jdom2.JDOMFactory.attribute.

This will create a new Attribute with the specified (local) name, value, and type, and in the provided org.jdom2.Namespace.
public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
)

Implements org.jdom2.JDOMFactory.attribute.

This will create a new Attribute with the specified (local) name and value, and does not place the attribute in a org.jdom2.Namespace.
public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
,
int
int type for new attribute.
type
)

Implements org.jdom2.JDOMFactory.attribute.

Deprecated
This will create a new Attribute with the specified (local) name, value and type, and does not place the attribute in a org.jdom2.Namespace.
public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
,
AttributeType
AttributeType type for new attribute.
type
)

Implements org.jdom2.JDOMFactory.attribute.

This will create a new Attribute with the specified (local) name, value and type, and does not place the attribute in a org.jdom2.Namespace.
public final CDATA
cdata(String
String content of CDATA.
str
)

Implements org.jdom2.JDOMFactory.cdata.

This creates the CDATA with the supplied text.
public CDATA
cdata(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String content of CDATA.
text
)

Implements org.jdom2.JDOMFactory.cdata.

This creates the CDATA with the supplied text.
public final Comment
comment(String
String content of comment.
text
)

Implements org.jdom2.JDOMFactory.comment.

This creates the comment with the supplied text.
public Comment
comment(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String content of comment.
text
)

Implements org.jdom2.JDOMFactory.comment.

This creates the comment with the supplied text.
public final DocType
docType(String
String name of element being constrained.
elementName
,
String
String public ID of referenced DTD
publicID
,
String
String system ID of referenced DTD
systemID
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and a reference to an external DTD.
public DocType
docType(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element being constrained.
elementName
,
String
String public ID of referenced DTD
publicID
,
String
String system ID of referenced DTD
systemID
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and a reference to an external DTD.
public final DocType
docType(String
String name of element being constrained.
elementName
,
String
String system ID of referenced DTD
systemID
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and reference to an external DTD.
public DocType
docType(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element being constrained.
elementName
,
String
String system ID of referenced DTD
systemID
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name and reference to an external DTD.
public final DocType
docType(String
String name of element being constrained.
elementName
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name
public DocType
docType(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element being constrained.
elementName
)

Implements org.jdom2.JDOMFactory.docType.

This will create the DocType with the specified element name
public Document
document(Element
Element for document root.
rootElement
,
DocType
DocType declaration.
docType
)

Implements org.jdom2.JDOMFactory.document.

This will create a new Document, with the supplied org.jdom2.Element as the root element and the supplied org.jdom2.DocType declaration.
public Document
document(Element
Element for document root.
rootElement
,
DocType
DocType declaration.
docType
,
String
the URI from which this document was loaded.
baseURI
)

Implements org.jdom2.JDOMFactory.document.

This will create a new Document, with the supplied org.jdom2.Element as the root element and the supplied org.jdom2.DocType declaration.
public Document
document(Element
Element for document root
rootElement
)

Implements org.jdom2.JDOMFactory.document.

This will create a new Document, with the supplied org.jdom2.Element as the root element, and no org.jdom2.DocType declaration.
public final Element
element(String
String name of element.
name
,
Namespace
Namespace to put element in.
namespace
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and define the org.jdom2.Namespace to be used.
public Element
element(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
,
Namespace
Namespace to put element in.
namespace
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and define the org.jdom2.Namespace to be used.
public final Element
element(String
String name of element.
name
)

Implements org.jdom2.JDOMFactory.element.

This will create an Element in no org.jdom2.Namespace.
public Element
element(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
)

Implements org.jdom2.JDOMFactory.element.

This will create an Element in no org.jdom2.Namespace.
public final Element
element(String
String name of element.
name
,
String
String URI for Namespace element should be in.
uri
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom2.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).
public Element
element(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
,
String
String URI for Namespace element should be in.
uri
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom2.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).
public final Element
element(String
String name of element.
name
,
String
the NamespacePrefic to use for this Element
prefix
,
String
String URI for Namespace element should be in.
uri
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom2.Namespace the Element should be in.
public Element
element(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
,
String
the NamespacePrefic to use for this Element
prefix
,
String
String URI for Namespace element should be in.
uri
)

Implements org.jdom2.JDOMFactory.element.

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom2.Namespace the Element should be in.
public final EntityRef
entityRef(String
String name of element.
name
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name.
public EntityRef
entityRef(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name.
public final EntityRef
entityRef(String
String name of element.
name
,
String
String public ID of element.
publicID
,
String
String system ID of element.
systemID
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name, public ID, and system ID.
public EntityRef
entityRef(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
,
String
String public ID of element.
publicID
,
String
String system ID of element.
systemID
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name, public ID, and system ID.
public final EntityRef
entityRef(String
String name of element.
name
,
String
String system ID of element.
systemID
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name and system ID.
public EntityRef
entityRef(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String name of element.
name
,
String
String system ID of element.
systemID
)

Implements org.jdom2.JDOMFactory.entityRef.

This will create a new EntityRef with the supplied name and system ID.
public final ProcessingInstruction
processingInstruction(String
String target of PI.
target
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and no data.
public ProcessingInstruction
processingInstruction(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String target of PI.
target
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and no data.
public final ProcessingInstruction
processingInstruction(String
String target of PI.
target
,
Map<String, String>
Map data for PI, in name/value pairs
data
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public ProcessingInstruction
processingInstruction(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String target of PI.
target
,
Map<String, String>
Map data for PI, in name/value pairs
data
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public final ProcessingInstruction
processingInstruction(String
String target of PI.
target
,
String
String data for PI.
data
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public ProcessingInstruction
processingInstruction(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String target of PI.
target
,
String
String data for PI.
data
)

Implements org.jdom2.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public void
setAttribute(Element
The Element to set the Attribute on
parent
,
Attribute
The Attribute to set
a
)

Implements org.jdom2.JDOMFactory.setAttribute.

Sets a specific Attribute on an Element
public void
setRoot(Document
The Document to set the Root Element of.
doc
,
Element
The Element to set as the root.
root
)

Implements org.jdom2.JDOMFactory.setRoot.

Sets the 'root' Element for a Document.
public final Text
text(String
String content of Text.
str
)

Implements org.jdom2.JDOMFactory.text.

This creates the Text with the supplied text.
public Text
text(final int
The line on which this content begins.
line
,
final int
The column on the line at which this content begins.
col
,
final String
String content of Text.
text
)

Implements org.jdom2.JDOMFactory.text.

This creates the Text with the supplied text.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait