Top Fields Constructors Methods
org.aspectj.weaver.loadtime.definition

public Class DocumentParser

extends DefaultHandler
Class Inheritance
Imports
java.io.IOException, .InputStream, java.net.URL, java.util.Hashtable, javax.xml.parsers.ParserConfigurationException, .SAXParserFactory, org.aspectj.util.LangUtil, org.aspectj.weaver.loadtime.definition.Definition.AdviceKind, .Definition.DeclareAnnotationKind, org.xml.sax.Attributes, .InputSource, .SAXException, .SAXParseException, .XMLReader, org.xml.sax.helpers.DefaultHandler, .XMLReaderFactory

Authors
Alexandre Vasseur, A. Nevado, Andy Clement

Field Summary

Modifier and TypeField and Description
private Definition.ConcreteAspect
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static boolean
private static final String
private static final String
private final Definition
private static final String
DTD_PUBLIC_ID

The current DTD public id. The matching dtd will be searched as a resource.

private static final String
DTD_PUBLIC_ID_ALIAS

The DTD alias, for better user experience.

private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private boolean
private boolean
private static final String
private boolean
private static final boolean
private static final String
private static final String
private static Hashtable<String, Definition>
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
deactivateCaching()

Turn off caching

public void
endElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
uri
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The qualified name (with prefix), or the empty string if qualified names are not available.
qName
)

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.
public void
error(SAXParseException
The error information encoded as an exception.
e
)

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable parser error.
public void
fatalError(SAXParseException
The error information encoded as an exception.
e
)

Overrides org.xml.sax.helpers.DefaultHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

Report a fatal XML parsing error.
private String
private static XMLReader
private boolean
private boolean
public static Definition
parse(final URL url)

private static String
replaceXmlAnd(String expression)

public InputSource
resolveEntity(String
The public identifier, or null if none is available.
publicId
,
String
The system identifier provided in the XML document.
systemId
)

Overrides org.xml.sax.helpers.DefaultHandler.resolveEntity.

Implements org.xml.sax.EntityResolver.resolveEntity.

Resolve an external entity.
private static Definition
public void
startElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
uri
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The qualified name (with prefix), or the empty string if qualified names are not available.
qName
,
Attributes
The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
attributes
)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.
public void
warning(SAXParseException
The warning information encoded as an exception.
e
)

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Receive notification of a parser warning.
Inherited from org.xml.sax.helpers.DefaultHandler:
charactersendDocumentendPrefixMappingignorableWhitespacenotationDeclprocessingInstructionsetDocumentLocatorskippedEntitystartDocumentstartPrefixMappingunparsedEntityDecl

Field Detail

activeConcreteAspectDefinitionback to summary
private Definition.ConcreteAspect activeConcreteAspectDefinition
AFTER_ELEMENTback to summary
private static final String AFTER_ELEMENT
AFTER_RETURNING_ELEMENTback to summary
private static final String AFTER_RETURNING_ELEMENT
AFTER_THROWING_ELEMENTback to summary
private static final String AFTER_THROWING_ELEMENT
AROUND_ELEMENTback to summary
private static final String AROUND_ELEMENT
ASPECT_ELEMENTback to summary
private static final String ASPECT_ELEMENT
ASPECTJ_ELEMENTback to summary
private static final String ASPECTJ_ELEMENT
ASPECTS_ELEMENTback to summary
private static final String ASPECTS_ELEMENT
BEFORE_ELEMENTback to summary
private static final String BEFORE_ELEMENT
CACHEback to summary
private static boolean CACHE
CONCRETE_ASPECT_ELEMENTback to summary
private static final String CONCRETE_ASPECT_ELEMENT
DECLARE_ANNOTATION_ELEMENTback to summary
private static final String DECLARE_ANNOTATION_ELEMENT
definitionback to summary
private final Definition definition
DTD_PUBLIC_IDback to summary
private static final String DTD_PUBLIC_ID

The current DTD public id. The matching dtd will be searched as a resource.

DTD_PUBLIC_ID_ALIASback to summary
private static final String DTD_PUBLIC_ID_ALIAS

The DTD alias, for better user experience.

DUMP_BEFOREANDAFTER_ATTRIBUTEback to summary
private static final String DUMP_BEFOREANDAFTER_ATTRIBUTE
DUMP_ELEMENTback to summary
private static final String DUMP_ELEMENT
DUMP_PERCLASSLOADERDIR_ATTRIBUTEback to summary
private static final String DUMP_PERCLASSLOADERDIR_ATTRIBUTE
EXCLUDE_ELEMENTback to summary
private static final String EXCLUDE_ELEMENT
EXPRESSION_ATTRIBUTEback to summary
private static final String EXPRESSION_ATTRIBUTE
EXTEND_ATTRIBUTEback to summary
private static final String EXTEND_ATTRIBUTE
inAspectJback to summary
private boolean inAspectJ
inAspectsback to summary
private boolean inAspects
INCLUDE_ELEMENTback to summary
private static final String INCLUDE_ELEMENT
inWeaverback to summary
private boolean inWeaver
LIGHTPARSERback to summary
private static final boolean LIGHTPARSER
NAME_ATTRIBUTEback to summary
private static final String NAME_ATTRIBUTE
OPTIONS_ATTRIBUTEback to summary
private static final String OPTIONS_ATTRIBUTE
parsedFilesback to summary
private static Hashtable<String, Definition> parsedFiles
PERCLAUSE_ATTRIBUTEback to summary
private static final String PERCLAUSE_ATTRIBUTE
POINTCUT_ELEMENTback to summary
private static final String POINTCUT_ELEMENT
PRECEDENCE_ATTRIBUTEback to summary
private static final String PRECEDENCE_ATTRIBUTE
REQUIRES_ATTRIBUTEback to summary
private static final String REQUIRES_ATTRIBUTE
SCOPE_ATTRIBUTEback to summary
private static final String SCOPE_ATTRIBUTE
WEAVER_ELEMENTback to summary
private static final String WEAVER_ELEMENT
WITHIN_ATTRIBUTEback to summary
private static final String WITHIN_ATTRIBUTE

Constructor Detail

DocumentParserback to summary
private DocumentParser()

Method Detail

deactivateCachingback to summary
public static void deactivateCaching()

Turn off caching

endElementback to summary
public void endElement(String uri, String localName, String qName) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.helpers.DefaultHandler.endElement.

Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Parameters
uri:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
errorback to summary
public void error(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Doc from org.xml.sax.helpers.DefaultHandler.error.

Receive notification of a recoverable parser error.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.

Parameters
e:SAXParseException

The error information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
fatalErrorback to summary
public void fatalError(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

Doc from org.xml.sax.helpers.DefaultHandler.fatalError.

Report a fatal XML parsing error.

The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.

Parameters
e:SAXParseException

The error information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
getWithinAttributeback to summary
private String getWithinAttribute(Attributes attributes)
getXMLReaderback to summary
private static XMLReader getXMLReader() throws SAXException, ParserConfigurationException
isNullback to summary
private boolean isNull(String s)
isTrueback to summary
private boolean isTrue(String s)
parseback to summary
public static Definition parse(final URL url) throws Exception
replaceXmlAndback to summary
private static String replaceXmlAnd(String expression)
resolveEntityback to summary
public InputSource resolveEntity(String publicId, String systemId) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.resolveEntity.

Implements org.xml.sax.EntityResolver.resolveEntity.

Doc from org.xml.sax.helpers.DefaultHandler.resolveEntity.

Resolve an external entity.

Always return null, so that the parser will use the system identifier provided in the XML document. This method implements the SAX default behaviour: application writers can override it in a subclass to do special translations such as catalog lookups or URI redirection.

Parameters
publicId:String

The public identifier, or null if none is available.

systemId:String

The system identifier provided in the XML document.

Returns:InputSource

The new input source, or null to require the default behaviour.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
saxParsingback to summary
private static Definition saxParsing(URL url) throws SAXException, ParserConfigurationException, IOException
startElementback to summary
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Parameters
uri:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

attributes:Attributes

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
warningback to summary
public void warning(SAXParseException e) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Doc from org.xml.sax.helpers.DefaultHandler.warning.

Receive notification of a parser warning.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.

Parameters
e:SAXParseException

The warning information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.