Top Description Fields Constructors Methods
org.jdom

public Class DefaultJDOMFactory

extends Object
implements JDOMFactory
Class Inheritance
All Implemented Interfaces
org.jdom.JDOMFactory
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
Version
$Revision: 1.7 $, $Date: 2007/11/10 05:28:58 $

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.jdom.JDOMFactory.attribute.

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
)

Implements org.jdom.JDOMFactory.attribute.

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
)

Implements org.jdom.JDOMFactory.attribute.

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
)

Implements org.jdom.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.jdom.Namespace.
public CDATA
cdata(String
String content of CDATA.
text
)

Implements org.jdom.JDOMFactory.cdata.

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

Implements org.jdom.JDOMFactory.comment.

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
)

Implements org.jdom.JDOMFactory.docType.

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
)

Implements org.jdom.JDOMFactory.docType.

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
)

Implements org.jdom.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.jdom.JDOMFactory.document.

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
)

Implements org.jdom.JDOMFactory.document.

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
)

Implements org.jdom.JDOMFactory.document.

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
)

Implements org.jdom.JDOMFactory.element.

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
)

Implements org.jdom.JDOMFactory.element.

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
)

Implements org.jdom.JDOMFactory.element.

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
)

Implements org.jdom.JDOMFactory.element.

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
)

Implements org.jdom.JDOMFactory.entityRef.

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
)

Implements org.jdom.JDOMFactory.entityRef.

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
)

Implements org.jdom.JDOMFactory.entityRef.

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
)

Implements org.jdom.JDOMFactory.processingInstruction.

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
)

Implements org.jdom.JDOMFactory.processingInstruction.

This will create a new ProcessingInstruction with the specified target and data.
public void
public Text
text(String
String content of Text.
text
)

Implements org.jdom.JDOMFactory.text.

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

Field Detail

CVS_IDback to summary
private static final String CVS_ID

Constructor Detail

DefaultJDOMFactoryback to summary
public DefaultJDOMFactory()

Method Detail

addContentback to summary
public void addContent(Parent parent, Content child)

Implements org.jdom.JDOMFactory.addContent.

addNamespaceDeclarationback to summary
public void addNamespaceDeclaration(Element parent, Namespace additional)

Implements org.jdom.JDOMFactory.addNamespaceDeclaration.

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

Implements org.jdom.JDOMFactory.attribute.

Doc from org.jdom.JDOMFactory.attribute.

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)

Implements org.jdom.JDOMFactory.attribute.

Doc from org.jdom.JDOMFactory.attribute.

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)

Implements org.jdom.JDOMFactory.attribute.

Doc from org.jdom.JDOMFactory.attribute.

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)

Implements org.jdom.JDOMFactory.attribute.

Doc from org.jdom.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.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 text)

Implements org.jdom.JDOMFactory.cdata.

Doc from org.jdom.JDOMFactory.cdata.

This creates the CDATA with the supplied text.

Parameters
text:String

String content of CDATA.

commentback to summary
public Comment comment(String text)

Implements org.jdom.JDOMFactory.comment.

Doc from org.jdom.JDOMFactory.comment.

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)

Implements org.jdom.JDOMFactory.docType.

Doc from org.jdom.JDOMFactory.docType.

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)

Implements org.jdom.JDOMFactory.docType.

Doc from org.jdom.JDOMFactory.docType.

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)

Implements org.jdom.JDOMFactory.docType.

Doc from org.jdom.JDOMFactory.docType.

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)

Implements org.jdom.JDOMFactory.document.

Doc from org.jdom.JDOMFactory.document.

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)

Implements org.jdom.JDOMFactory.document.

Doc from org.jdom.JDOMFactory.document.

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)

Implements org.jdom.JDOMFactory.document.

Doc from org.jdom.JDOMFactory.document.

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)

Implements org.jdom.JDOMFactory.element.

Doc from org.jdom.JDOMFactory.element.

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)

Implements org.jdom.JDOMFactory.element.

Doc from org.jdom.JDOMFactory.element.

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)

Implements org.jdom.JDOMFactory.element.

Doc from org.jdom.JDOMFactory.element.

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)

Implements org.jdom.JDOMFactory.element.

Doc from org.jdom.JDOMFactory.element.

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)

Implements org.jdom.JDOMFactory.entityRef.

Doc from org.jdom.JDOMFactory.entityRef.

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)

Implements org.jdom.JDOMFactory.entityRef.

Doc from org.jdom.JDOMFactory.entityRef.

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)

Implements org.jdom.JDOMFactory.entityRef.

Doc from org.jdom.JDOMFactory.entityRef.

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)

Implements org.jdom.JDOMFactory.processingInstruction.

Doc from org.jdom.JDOMFactory.processingInstruction.

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)

Implements org.jdom.JDOMFactory.processingInstruction.

Doc from org.jdom.JDOMFactory.processingInstruction.

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 parent, Attribute a)

Implements org.jdom.JDOMFactory.setAttribute.

textback to summary
public Text text(String text)

Implements org.jdom.JDOMFactory.text.

Doc from org.jdom.JDOMFactory.text.

This creates the Text with the supplied text.

Parameters
text:String

String content of Text.