|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.generators.genbase.utils.XMLUtils
public class XMLUtils
XML Utils Class. Holds methods for easier DOM parsing, XML modifications, ...
Method Summary | |
---|---|
static void |
addClient(Document app,
Archive client)
Add a client module in an application Document |
static void |
addEjb(Document app,
Archive ejbjar)
Add an ejb module in an application Document |
static void |
addWebApp(Document app,
Archive webapp,
String ctx)
Add an web module in an application Document |
static void |
cleanDummyApplication(Document doc)
default application.xml contains a fake ejb module needed to be parsed without error but not needed for a normal application. |
static Element |
getBeanElement(Element base,
String bName)
Returns the session /entity /
message-driven XML Element with given name. |
static Element |
getJonasServiceRef(Element base,
String srName)
Returns the jonas-service-ref XML Element with given name. |
static Element |
getServletElement(Element base,
String sName)
Returns the matching servlet XML Element with given name. |
static boolean |
isWebModuleAlreadyDeclared(Document app,
String name)
Check if the web module name is already declared in the application.xml Document |
static Document |
newDocument(InputStream is,
String name,
boolean isDTDsAllowed)
Creates a new Document from a given InputStream. |
static Document |
newDocument(InputStream is,
String name,
boolean isDTDsAllowed,
boolean validate)
Creates a new Document from a given InputStream. |
static Document |
newJonasClient()
Creates a new XML Document for an empty jonas-client.xml. |
static Document |
newJonasWeb()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Document newDocument(InputStream is, String name, boolean isDTDsAllowed) throws ParserConfigurationException, SAXException, IOException, NoJ2EEWebservicesException
is
- the InputStream to be parsedname
- filenameisDTDsAllowed
- if false, throw exception on DTD Doctype
ParserConfigurationException
- ParserConfigurationException
SAXException
- SAXException
IOException
- IOException
NoJ2EEWebservicesException
- NoJ2EEWebservicesExceptionpublic static Document newDocument(InputStream is, String name, boolean isDTDsAllowed, boolean validate) throws NoJ2EEWebservicesException, ParserConfigurationException, SAXException, IOException
is
- the InputStream to be parsedname
- filenameisDTDsAllowed
- if false, throw exception on DTD Doctypevalidate
- if the file is to be validated
ParserConfigurationException
- ParserConfigurationException
SAXException
- SAXException
IOException
- IOException
NoJ2EEWebservicesException
- NoJ2EEWebservicesExceptionpublic static Element getBeanElement(Element base, String bName)
session
/entity
/
message-driven
XML Element with given name.
base
- jonas-ejb-jar
Element.bName
- the bean name to be found.
session
/entity
/
message-driven
XML Element.public static Element getServletElement(Element base, String sName)
servlet
XML Element with given name.
base
- web-app
Element.sName
- the servlet name to be found.
servlet
XML Element.public static Element getJonasServiceRef(Element base, String srName)
jonas-service-ref
XML Element with given name.
base
- web-app
/ bean Element containing
jonas-service-ref
Element(s).srName
- the service-ref name to be found.
jonas-service-ref
XML Element.public static void cleanDummyApplication(Document doc)
doc
- application.xml documentpublic static void addEjb(Document app, Archive ejbjar)
app
- application.xml Documentejbjar
- EJBJar archivepublic static void addClient(Document app, Archive client)
app
- application.xml Documentclient
- Client archivepublic static void addWebApp(Document app, Archive webapp, String ctx)
app
- application.xml Documentwebapp
- WebApp archivectx
- context-rootpublic static Document newJonasClient()
public static Document newJonasWeb()
public static boolean isWebModuleAlreadyDeclared(Document app, String name)
app
- the application.xml Docname
- web application name
true
if the module is already declared, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |