org.codehaus.aspectwerkz.definition
Class XmlParser

java.lang.Object
  extended byorg.codehaus.aspectwerkz.definition.XmlParser

public class XmlParser
extends Object

Parses the XML definition file using dom4j.

Author:
Jonas Bonér

Constructor Summary
XmlParser()
           
 
Method Summary
static org.dom4j.Document createDocument(InputStream stream)
          Creates a DOM document.
static org.dom4j.Document createDocument(URL url)
          Creates a DOM document.
static List getAspectClassNames(File definitionFile)
           
static List getAspectClassNames(InputStream stream)
           
static List getAspectClassNames(URL definitionURL)
           
static org.dom4j.Document mergeDocuments(org.dom4j.Document document1, org.dom4j.Document document2)
          Merges two DOM documents.
static List parse(ClassLoader loader, File definitionFile, boolean isDirty)
          Parses the XML definition file, only if it has been updated.
static List parse(ClassLoader loader, InputStream stream)
          Parses the XML definition file retrieved from an input stream.
static List parseNoCache(ClassLoader loader, URL url)
          Parses the XML definition file not using the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlParser

public XmlParser()
Method Detail

getAspectClassNames

public static List getAspectClassNames(File definitionFile)
Parameters:
definitionFile - the definition file
Returns:
the definitions

getAspectClassNames

public static List getAspectClassNames(URL definitionURL)

getAspectClassNames

public static List getAspectClassNames(InputStream stream)
Parameters:
stream - the input stream containing the document
Returns:
the definitions

parse

public static List parse(ClassLoader loader,
                         File definitionFile,
                         boolean isDirty)
Parses the XML definition file, only if it has been updated. Uses a timestamp to check for modifications.

Parameters:
loader - the current class loader
definitionFile - the definition file
isDirty - flag to mark the the definition as updated or not
Returns:
the definitions

parse

public static List parse(ClassLoader loader,
                         InputStream stream)
Parses the XML definition file retrieved from an input stream.

Parameters:
loader - the current class loader
stream - the input stream containing the document
Returns:
the definitions

parseNoCache

public static List parseNoCache(ClassLoader loader,
                                URL url)
Parses the XML definition file not using the cache.

Parameters:
loader - the current class loader
url - the URL to the definition file
Returns:
the definition object

mergeDocuments

public static org.dom4j.Document mergeDocuments(org.dom4j.Document document1,
                                                org.dom4j.Document document2)
Merges two DOM documents.

Parameters:
document1 - the first document
document2 - the second document
Returns:
the definition merged document

createDocument

public static org.dom4j.Document createDocument(URL url)
                                         throws org.dom4j.DocumentException
Creates a DOM document.

Parameters:
url - the URL to the file containing the XML
Returns:
the DOM document
Throws:
org.dom4j.DocumentException
org.dom4j.DocumentException

createDocument

public static org.dom4j.Document createDocument(InputStream stream)
                                         throws org.dom4j.DocumentException
Creates a DOM document.

Parameters:
stream - the stream containing the XML
Returns:
the DOM document
Throws:
org.dom4j.DocumentException
org.dom4j.DocumentException


Copyright © 2002-2004 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.