org.codehaus.aspectwerkz.definition
Class XmlDefinitionParser

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

public class XmlDefinitionParser
extends java.lang.Object

Parses the XML definition file using dom4j.

Author:
Jonas Bonér

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

Constructor Detail

XmlDefinitionParser

public XmlDefinitionParser()
Method Detail

parse

public static AspectWerkzDefinition parse(java.io.File definitionFile)
Parses the XML definition file.

Parameters:
definitionFile - the definition file
Returns:
the definition object

parse

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

Parameters:
definitionFile - the definition file
isDirty - flag to mark the the definition as updated or not
Returns:
the definition object

parse

public static AspectWerkzDefinition parse(java.io.InputStream stream)
Parses the XML definition file retrieved from an input stream.

Parameters:
stream - the input stream containing the document
Returns:
the definition object

parseNoCache

public static AspectWerkzDefinition parseNoCache(java.net.URL url)
Parses the XML definition file not using the cache.

Parameters:
url - the URL to the definition file
Returns:
the definition object

parse

public static AspectWerkzDefinition parse(org.dom4j.Document document)
Parses the definition DOM document.

Parameters:
document - the defintion as a document
Returns:
the definition

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(java.net.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
java.net.MalformedURLException

createDocument

public static org.dom4j.Document createDocument(java.io.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
java.net.MalformedURLException


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.