Top Description Methods
org.jdom

public Interface JDOMFactory

Known Direct Implementers
org.jdom.UncheckedJDOMFactory, org.jdom.DefaultJDOMFactory
Imports
java.util.*

An interface to be used by builders when constructing JDOM objects. The DefaultJDOMFactory creates the standard top-level JDOM classes (Element, Document, Comment, etc). Another implementation of this factory could be used to create custom classes.
Authors
Ken Rune Holland, Phil Nelson, Bradley S. Huffman
Version
$Revision: 1.9 $, $Date: 2007/11/10 05:28:59 $

Method Summary

Modifier and TypeMethod and Description
public void
addContent(Parent parent, Content content)

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

This will create a new Attribute with the specified (local) name and value, and in the provided org.jdom.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
)

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

public Attribute
attribute(String
String name of Attribute.
name
,
String
String value for new attribute.
value
)

This will create a new Attribute with the specified (local) name and value, and does not place the attribute in a org.jdom.Namespace.

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

This will create a new Attribute with the specified (local) name, value and type, and does not place the attribute in a org.jdom.Namespace.

public CDATA
cdata(String
String content of CDATA.
str
)

This creates the CDATA with the supplied text.

public Comment
comment(String
String content of comment.
text
)

This creates the comment with the supplied text.

public 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
)

This will create the DocType with the specified element name and a reference to an external DTD.

public DocType
docType(String
String name of element being constrained.
elementName
,
String
String system ID of referenced DTD
systemID
)

This will create the DocType with the specified element name and reference to an external DTD.

public DocType
docType(String
String name of element being constrained.
elementName
)

This will create the DocType with the specified element name

public Document
document(Element
Element for document root.
rootElement
,
DocType
DocType declaration.
docType
)

This will create a new Document, with the supplied org.jdom.Element as the root element and the supplied org.jdom.DocType declaration.

public Document
document(Element
Element for document root.
rootElement
,
DocType
DocType declaration.
docType
,
String
the URI from which this doucment was loaded.
baseURI
)

This will create a new Document, with the supplied org.jdom.Element as the root element and the supplied org.jdom.DocType declaration.

public Document
document(Element
Element for document root
rootElement
)

This will create a new Document, with the supplied org.jdom.Element as the root element, and no org.jdom.DocType declaration.

public Element
element(String
String name of element.
name
,
Namespace
Namespace to put element in.
namespace
)

This will create a new Element with the supplied (local) name, and define the org.jdom.Namespace to be used.

public Element
element(String
String name of element.
name
)

This will create an Element in no org.jdom.Namespace.

public Element
element(String
String name of element.
name
,
String
String URI for Namespace element should be in.
uri
)

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).

public Element
element(String
String name of element.
name
,
String prefix, String
String URI for Namespace element should be in.
uri
)

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom.Namespace the Element should be in.

public EntityRef
entityRef(String
String name of element.
name
)

This will create a new EntityRef with the supplied name.

public EntityRef
entityRef(String
String name of element.
name
,
String
String public ID of element.
publicID
,
String
String system ID of element.
systemID
)

This will create a new EntityRef with the supplied name, public ID, and system ID.

public EntityRef
entityRef(String
String name of element.
name
,
String
String system ID of element.
systemID
)

This will create a new EntityRef with the supplied name and system ID.

public ProcessingInstruction
processingInstruction(String
String target of PI.
target
,
Map<K, V>
Map data for PI, in name/value pairs
data
)

This will create a new ProcessingInstruction with the specified target and data.

public ProcessingInstruction
processingInstruction(String
String target of PI.
target
,
String
String data for PI.
data
)

This will create a new ProcessingInstruction with the specified target and data.

public void
public Text
text(String
String content of Text.
str
)

This creates the Text with the supplied text.

Method Detail

addContentback to summary
public void addContent(Parent parent, Content content)
addNamespaceDeclarationback to summary
public void addNamespaceDeclaration(Element element, Namespace additional)
attributeback to summary
public Attribute attribute(String name, String value, Namespace namespace)

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

Parameters
name:String

String name of Attribute.

value:String

String value for new attribute.

attributeback to summary
public Attribute attribute(String name, String value, int type, Namespace namespace)

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

Parameters
name:String

String name of Attribute.

value:String

String value for new attribute.

type:int

int type for new attribute.

namespace:Namespace

Namespace namespace for new attribute.

attributeback to summary
public Attribute attribute(String name, String value)

This will create a new Attribute with the specified (local) name and value, and does not place the attribute in a org.jdom.Namespace.

Note

This actually explicitly puts the Attribute in the "empty" Namespace (org.jdom.Namespace#NO_NAMESPACE).

Parameters
name:String

String name of Attribute.

value:String

String value for new attribute.

attributeback to summary
public Attribute attribute(String name, String value, int type)

This will create a new Attribute with the specified (local) name, value and type, and does not place the attribute in a org.jdom.Namespace.

Note

This actually explicitly puts the Attribute in the "empty" Namespace (org.jdom.Namespace#NO_NAMESPACE).

Parameters
name:String

String name of Attribute.

value:String

String value for new attribute.

type:int

int type for new attribute.

cdataback to summary
public CDATA cdata(String str)

This creates the CDATA with the supplied text.

Parameters
str:String

String content of CDATA.

commentback to summary
public Comment comment(String text)

This creates the comment with the supplied text.

Parameters
text:String

String content of comment.

docTypeback to summary
public DocType docType(String elementName, String publicID, String systemID)

This will create the DocType with the specified element name and a reference to an external DTD.

Parameters
elementName:String

String name of element being constrained.

publicID:String

String public ID of referenced DTD

systemID:String

String system ID of referenced DTD

docTypeback to summary
public DocType docType(String elementName, String systemID)

This will create the DocType with the specified element name and reference to an external DTD.

Parameters
elementName:String

String name of element being constrained.

systemID:String

String system ID of referenced DTD

docTypeback to summary
public DocType docType(String elementName)

This will create the DocType with the specified element name

Parameters
elementName:String

String name of element being constrained.

documentback to summary
public Document document(Element rootElement, DocType docType)

This will create a new Document, with the supplied org.jdom.Element as the root element and the supplied org.jdom.DocType declaration.

Parameters
rootElement:Element

Element for document root.

docType:DocType

DocType declaration.

documentback to summary
public Document document(Element rootElement, DocType docType, String baseURI)

This will create a new Document, with the supplied org.jdom.Element as the root element and the supplied org.jdom.DocType declaration.

Parameters
rootElement:Element

Element for document root.

docType:DocType

DocType declaration.

baseURI:String

the URI from which this doucment was loaded.

documentback to summary
public Document document(Element rootElement)

This will create a new Document, with the supplied org.jdom.Element as the root element, and no org.jdom.DocType declaration.

Parameters
rootElement:Element

Element for document root

elementback to summary
public Element element(String name, Namespace namespace)

This will create a new Element with the supplied (local) name, and define the org.jdom.Namespace to be used.

Parameters
name:String

String name of element.

namespace:Namespace

Namespace to put element in.

elementback to summary
public Element element(String name)

This will create an Element in no org.jdom.Namespace.

Parameters
name:String

String name of element.

elementback to summary
public Element element(String name, String uri)

This will create a new Element with the supplied (local) name, and specifies the URI of the org.jdom.Namespace the Element should be in, resulting it being unprefixed (in the default namespace).

Parameters
name:String

String name of element.

uri:String

String URI for Namespace element should be in.

elementback to summary
public Element element(String name, String prefix, String uri)

This will create a new Element with the supplied (local) name, and specifies the prefix and URI of the org.jdom.Namespace the Element should be in.

Parameters
name:String

String name of element.

uri:String

String URI for Namespace element should be in.

entityRefback to summary
public EntityRef entityRef(String name)

This will create a new EntityRef with the supplied name.

Parameters
name:String

String name of element.

entityRefback to summary
public EntityRef entityRef(String name, String publicID, String systemID)

This will create a new EntityRef with the supplied name, public ID, and system ID.

Parameters
name:String

String name of element.

publicID:String

String public ID of element.

systemID:String

String system ID of element.

entityRefback to summary
public EntityRef entityRef(String name, String systemID)

This will create a new EntityRef with the supplied name and system ID.

Parameters
name:String

String name of element.

systemID:String

String system ID of element.

processingInstructionback to summary
public ProcessingInstruction processingInstruction(String target, Map<K, V> data)

This will create a new ProcessingInstruction with the specified target and data.

Parameters
target:String

String target of PI.

data:Map<K, V>

Map data for PI, in name/value pairs

processingInstructionback to summary
public ProcessingInstruction processingInstruction(String target, String data)

This will create a new ProcessingInstruction with the specified target and data.

Parameters
target:String

String target of PI.

data:String

String data for PI.

setAttributeback to summary
public void setAttribute(Element element, Attribute a)
textback to summary
public Text text(String str)

This creates the Text with the supplied text.

Parameters
str:String

String content of Text.