org.codehaus.aspectwerkz.definition
Class XmlParser

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

public class XmlParser
extends java.lang.Object

Parses the XML definition file using dom4j.

Author:
Jonas Bonér

Field Summary
static java.lang.String MODEL_TYPE_ATTRIB
           
static java.lang.String MODEL_TYPE_XML
           
 
Constructor Summary
XmlParser()
           
 
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 java.util.List parse(org.dom4j.Document document)
          Parses the definition DOM document.
static java.util.List parse(java.io.File definitionFile)
          Parses the XML definition file.
static java.util.List parse(java.io.File definitionFile, boolean isDirty)
          Parses the XML definition file, only if it has been updated.
static java.util.List parse(java.io.InputStream stream)
          Parses the XML definition file retrieved from an input stream.
static java.util.List 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
 

Field Detail

MODEL_TYPE_ATTRIB

public static final java.lang.String MODEL_TYPE_ATTRIB
See Also:
Constant Field Values

MODEL_TYPE_XML

public static final java.lang.String MODEL_TYPE_XML
See Also:
Constant Field Values
Constructor Detail

XmlParser

public XmlParser()
Method Detail

parse

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

Parameters:
definitionFile - the definition file
Returns:
the definitions

parse

public static java.util.List 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 definitions

parse

public static java.util.List 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 definitions

parseNoCache

public static java.util.List 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 java.util.List parse(org.dom4j.Document document)
Parses the definition DOM document.

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

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
org.dom4j.DocumentException

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
org.dom4j.DocumentException


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