Package org.codehaus.cargo.module
Class AbstractDescriptorType
- java.lang.Object
-
- org.jdom2.DefaultJDOMFactory
-
- org.codehaus.cargo.module.AbstractDescriptorType
-
- All Implemented Interfaces:
DescriptorType
,org.jdom2.JDOMFactory
- Direct Known Subclasses:
ApplicationXmlType
,EjbJarXmlType
,IbmEjbJarBndXmiType
,IbmWebBndXmiType
,JBossWebXmlType
,JBossXmlType
,OrionEjbJarXmlType
,OrionWebXmlType
,ResinWebXmlType
,TomcatContextXmlType
,WeblogicEjbJarXmlType
,WeblogicXmlType
,WebXmlType
public class AbstractDescriptorType extends org.jdom2.DefaultJDOMFactory implements DescriptorType
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDescriptorType(DescriptorType parent, Class descriptorClass, Grammar grammar)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTag(DescriptorTag tag)
Add a descriptor tag to this descriptor type.org.jdom2.Document
document(org.jdom2.Element rootElement)
Create a JDOM Document.org.jdom2.Element
element(int line, int col, String name)
org.jdom2.Element
element(int line, int col, String name, org.jdom2.Namespace namespace)
Collection<DescriptorTag>
getAllTags()
Get all defined tags for this descriptor.DescriptorIo
getDescriptorIo()
Get the IO class for this descriptor type.Grammar
getGrammar()
Get the grammar for this descriptor type.org.jdom2.JDOMFactory
getJDOMFactory()
DescriptorTag
getTagByName(String name)
Get a descriptor tag by name.protected void
setDescriptorIo(DescriptorIo descriptorIo)
Set the IO class for this descriptor type.-
Methods inherited from class org.jdom2.DefaultJDOMFactory
addContent, addNamespaceDeclaration, attribute, attribute, attribute, attribute, attribute, attribute, cdata, cdata, comment, comment, docType, docType, docType, docType, docType, docType, document, document, element, element, element, element, element, element, entityRef, entityRef, entityRef, entityRef, entityRef, entityRef, processingInstruction, processingInstruction, processingInstruction, processingInstruction, processingInstruction, processingInstruction, setAttribute, setRoot, text, text
-
-
-
-
Constructor Detail
-
AbstractDescriptorType
protected AbstractDescriptorType(DescriptorType parent, Class descriptorClass, Grammar grammar)
Constructor.- Parameters:
parent
- the parent of this typedescriptorClass
- the class that implements this descriptorgrammar
- grammar for this type (or null if none).
-
-
Method Detail
-
getDescriptorIo
public DescriptorIo getDescriptorIo()
Get the IO class for this descriptor type.- Specified by:
getDescriptorIo
in interfaceDescriptorType
- Returns:
- the IO class
-
setDescriptorIo
protected void setDescriptorIo(DescriptorIo descriptorIo)
Set the IO class for this descriptor type.- Parameters:
descriptorIo
- the IO class
-
getGrammar
public Grammar getGrammar()
Get the grammar for this descriptor type.- Specified by:
getGrammar
in interfaceDescriptorType
- Returns:
- grammar
-
addTag
public void addTag(DescriptorTag tag)
Add a descriptor tag to this descriptor type.- Specified by:
addTag
in interfaceDescriptorType
- Parameters:
tag
- the tag to add.
-
getTagByName
public DescriptorTag getTagByName(String name)
Description copied from interface:DescriptorType
Get a descriptor tag by name.- Specified by:
getTagByName
in interfaceDescriptorType
- Parameters:
name
- name of the tag- Returns:
- the matching descriptor tag
-
getAllTags
public Collection<DescriptorTag> getAllTags()
Description copied from interface:DescriptorType
Get all defined tags for this descriptor.- Specified by:
getAllTags
in interfaceDescriptorType
- Returns:
- a collection of all tags
-
element
public org.jdom2.Element element(int line, int col, String name)
- Specified by:
element
in interfaceorg.jdom2.JDOMFactory
- Overrides:
element
in classorg.jdom2.DefaultJDOMFactory
-
element
public org.jdom2.Element element(int line, int col, String name, org.jdom2.Namespace namespace)
- Specified by:
element
in interfaceorg.jdom2.JDOMFactory
- Overrides:
element
in classorg.jdom2.DefaultJDOMFactory
-
document
public org.jdom2.Document document(org.jdom2.Element rootElement)
Create a JDOM Document.- Specified by:
document
in interfaceorg.jdom2.JDOMFactory
- Overrides:
document
in classorg.jdom2.DefaultJDOMFactory
- Parameters:
rootElement
- the root element for the document- Returns:
- the document created
-
getJDOMFactory
public org.jdom2.JDOMFactory getJDOMFactory()
- Specified by:
getJDOMFactory
in interfaceDescriptorType
- Returns:
- JDOM Factory that can create typed descriptor elements.
-
-