You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-cvs@xml.apache.org by je...@apache.org on 2006/02/04 11:14:52 UTC
svn commit: r374855 [2/4] - in
/xml/commons/branches/external-extended/java/external: ./ src/org/w3c/css/
src/org/w3c/css/sac/ src/org/w3c/css/sac/helpers/ src/org/w3c/dom/events/
src/org/w3c/dom/smil/ src/org/w3c/dom/svg/
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/DocumentHandler.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/DocumentHandler.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/DocumentHandler.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/DocumentHandler.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: DocumentHandler.java,v 1.4 2000/02/16 21:29:35 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * This is the main interface that most CSS applications implement: if the
+ * application needs to be informed of basic parsing events, it implements this
+ * interface and registers an instance with the CSS parser using the
+ * setCSSHandler method.
+ *
+ * @version $Revision: 1.4 $
+ * @author Philippe Le Hegaret
+ */
+public interface DocumentHandler {
+
+ /**
+ * Receive notification of the beginning of a style sheet.
+ *
+ * The CSS parser will invoke this method only once, before any other
+ * methods in this interface.
+ *
+ * @param uri The URI of the style sheet. @@TODO can be NULL ! (inline style sheet)
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void startDocument(InputSource source)
+ throws CSSException;
+
+ /**
+ * Receive notification of the end of a document.
+ *
+ * The CSS parser will invoke this method only once, and it will be the
+ * last method invoked during the parse. The parser shall not invoke this
+ * method until it has either abandoned parsing (because of an
+ * unrecoverable error) or reached the end of input.
+ *
+ * @param uri The URI of the style sheet.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void endDocument(InputSource source) throws CSSException;
+
+ /**
+ * Receive notification of a comment.
+ * If the comment appears in a declaration (e.g. color: /* comment * / blue;),
+ * the parser notifies the comment before the declaration.
+ *
+ * @param text The comment.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void comment(String text) throws CSSException;
+
+ /**
+ * Receive notification of an unknown rule t-rule not supported by this
+ * parser.
+ *
+ * @param at-rule The complete ignored at-rule.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void ignorableAtRule(String atRule) throws CSSException;
+
+ /**
+ * Receive notification of an unknown rule t-rule not supported by this
+ * parser.
+ *
+ * @param prefix <code>null</code> if this is the default namespace
+ * @param uri The URI for this namespace.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void namespaceDeclaration(String prefix, String uri)
+ throws CSSException;
+
+ /**
+ * Receive notification of a import statement in the style sheet.
+ *
+ * @param uri The URI of the imported style sheet.
+ * @param media The intended destination media for style information.
+ * @param defaultNamepaceURI The default namespace URI for the imported
+ * style sheet.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void importStyle(String uri, SACMediaList media,
+ String defaultNamespaceURI)
+ throws CSSException;
+
+ /**
+ * Receive notification of the beginning of a media statement.
+ *
+ * The Parser will invoke this method at the beginning of every media
+ * statement in the style sheet. there will be a corresponding endMedia()
+ * event for every startElement() event.
+ *
+ * @param media The intended destination media for style information.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void startMedia(SACMediaList media) throws CSSException;
+
+ /**
+ * Receive notification of the end of a media statement.
+ *
+ * @param media The intended destination media for style information.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void endMedia(SACMediaList media) throws CSSException;
+
+ /**
+ * Receive notification of the beginning of a page statement.
+ *
+ * The Parser will invoke this method at the beginning of every page
+ * statement in the style sheet. there will be a corresponding endPage()
+ * event for every startPage() event.
+ *
+ * @param name the name of the page (if any, null otherwise)
+ * @param pseudo_page the pseudo page (if any, null otherwise)
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void startPage(String name, String pseudo_page) throws CSSException;
+
+ /**
+ * Receive notification of the end of a media statement.
+ *
+ * @param media The intended destination medium for style information.
+ * @param pseudo_page the pseudo page (if any, null otherwise)
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void endPage(String name, String pseudo_page) throws CSSException;
+
+ /**
+ * Receive notification of the beginning of a font face statement.
+ *
+ * The Parser will invoke this method at the beginning of every font face
+ * statement in the style sheet. there will be a corresponding endFontFace()
+ * event for every startFontFace() event.
+ *
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void startFontFace() throws CSSException;
+
+ /**
+ * Receive notification of the end of a font face statement.
+ *
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void endFontFace() throws CSSException;
+
+ /**
+ * Receive notification of the beginning of a rule statement.
+ *
+ * @param selectors All intended selectors for all declarations.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void startSelector(SelectorList selectors) throws CSSException;
+
+ /**
+ * Receive notification of the end of a rule statement.
+ *
+ * @param selectors All intended selectors for all declarations.
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void endSelector(SelectorList selectors) throws CSSException;
+
+ /**
+ * Receive notification of a declaration.
+ *
+ * @param name the name of the property.
+ * @param value the value of the property. All whitespace are stripped.
+ * @param important is this property important ?
+ * @exception CSSException Any CSS exception, possibly wrapping another
+ * exception.
+ */
+ public void property(String name, LexicalUnit value, boolean important)
+ throws CSSException;
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/DocumentHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ElementSelector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ElementSelector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ElementSelector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ElementSelector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ *
+ * $Id: ElementSelector.java,v 1.6 2000/02/14 15:54:12 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.6 $
+ * @author Philippe Le Hegaret
+ * @see Selector#SAC_ELEMENT_NODE_SELECTOR
+ */
+public interface ElementSelector extends SimpleSelector {
+
+ /**
+ * Returns the
+ * <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace
+ * URI</a> of this element selector.
+ * <p><code>NULL</code> if this element selector can match any namespace.</p>
+ */
+ public String getNamespaceURI();
+
+ /**
+ * Returns the
+ * <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local part</a>
+ * of the
+ * <a href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames">qualified
+ * name</a> of this element.
+ * <p><code>NULL</code> if this element selector can match any element.</p>
+ * </ul>
+ */
+ public String getLocalName();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ElementSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ErrorHandler.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ErrorHandler.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ErrorHandler.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ErrorHandler.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * The original version of this interface comes from SAX :
+ * http://www.megginson.com/SAX/
+ *
+ * $Id: ErrorHandler.java,v 1.2 1999/09/26 10:10:34 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * Basic interface for CSS error handlers.
+ *
+ * <p>If a CSS application needs to implement customized error
+ * handling, it must implement this interface and then register an
+ * instance with the CSS parser using the parser's setErrorHandler
+ * method. The parser will then report all errors and warnings
+ * through this interface.</p>
+ *
+ * <p> The parser shall use this interface instead of throwing an
+ * exception: it is up to the application whether to throw an
+ * exception for different types of errors and warnings. Note,
+ * however, that there is no requirement that the parser continue to
+ * provide useful information after a call to fatalError (in other
+ * words, a CSS driver class could catch an exception and report a
+ * fatalError).</p>
+ *
+ * <p>The HandlerBase class provides a default implementation of this
+ * interface, ignoring warnings and recoverable errors and throwing a
+ * SAXParseException for fatal errors. An application may extend
+ * that class rather than implementing the complete interface
+ * itself.</p>
+ *
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret
+ */
+public interface ErrorHandler {
+
+
+ /**
+ * Receive notification of a warning.
+ *
+ * <p>CSS parsers will use this method to report conditions that
+ * are not errors or fatal errors as defined by the XML 1.0
+ * recommendation. The default behaviour is to take no action.</p>
+ *
+ * <p>The CSS parser must continue to provide normal parsing events
+ * after invoking this method: it should still be possible for the
+ * application to process the document through to the end.</p>
+ *
+ * @param exception The warning information encapsulated in a
+ * CSS parse exception.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @see CSSParseException
+ */
+ public void warning(CSSParseException exception) throws CSSException;
+
+ /**
+ * Receive notification of a recoverable error.
+ *
+ * <p>This corresponds to the definition of "error" in section 1.2
+ * of the W3C XML 1.0 Recommendation. For example, a validating
+ * parser would use this callback to report the violation of a
+ * validity constraint. The default behaviour is to take no
+ * action.</p>
+ *
+ * <p>The CSS parser must continue to provide normal parsing events
+ * after invoking this method: it should still be possible for the
+ * application to process the document through to the end. If the
+ * application cannot do so, then the parser should report a fatal
+ * error even if the XML 1.0 recommendation does not require it to
+ * do so.</p>
+ *
+ * @param exception The error information encapsulated in a
+ * CSS parse exception.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @see CSSParseException
+ */
+ public void error(CSSParseException exception) throws CSSException;
+
+ /**
+ * Receive notification of a non-recoverable error.
+ *
+ * <p>This corresponds to the definition of "fatal error" in
+ * section 1.2 of the W3C XML 1.0 Recommendation. For example, a
+ * parser would use this callback to report the violation of a
+ * well-formedness constraint.</p>
+ *
+ * <p>The application must assume that the document is unusable
+ * after the parser has invoked this method, and should continue
+ * (if at all) only for the sake of collecting addition error
+ * messages: in fact, CSS parsers are free to stop reporting any
+ * other events once this method has been invoked.</p>
+ *
+ * @param exception The error information encapsulated in a
+ * CSS parse exception.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @see CSSParseException
+ */
+ public void fatalError(CSSParseException exception) throws CSSException;
+
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ErrorHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/InputSource.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/InputSource.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/InputSource.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/InputSource.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * The original version of this interface comes from SAX :
+ * http://www.megginson.com/SAX/
+ *
+ * $Id: InputSource.java,v 1.2 1999/09/26 10:09:48 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+import java.io.InputStream;
+import java.io.Reader;
+
+/**
+ * A single input source for a CSS source.
+ *
+ * <p>This class allows a CSS application to encapsulate information about an
+ * input source in a single object, which may include a URI, a byte stream
+ * (possibly with a specified encoding), and/or a character stream.</p>
+ *
+ * <p>The CSS parser will use the InputSource object to determine how
+ * to read CSS input. If there is a character stream available, the
+ * parser will read that stream directly; if not, the parser will use
+ * a byte stream, if available; if neither a character stream nor a
+ * byte stream is available, the parser will attempt to open a URI
+ * connection to the resource identified by the URI.</p>
+ *
+ * <p>An InputSource object belongs to the application: the CSS parser
+ * shall never modify it in any way (it may modify a copy if
+ * necessary).</p>
+ *
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret
+ */
+public class InputSource {
+
+ private String uri;
+ private InputStream byteStream;
+ private String encoding;
+ private Reader characterStream;
+ private String title;
+ private String media;
+
+ /**
+ * Zero-argument default constructor.
+ *
+ * @see #setURI
+ * @see #setByteStream
+ * @see #setCharacterStream
+ * @see #setEncoding
+ */
+ public InputSource() {
+ }
+
+ /**
+ * Create a new input source with a URI.
+ *
+ * <p>The URI must be full resolved.</p>
+ *
+ * @param uri The URI.
+ * @see #setURI
+ * @see #setByteStream
+ * @see #setEncoding
+ * @see #setCharacterStream
+ */
+ public InputSource(String uri) {
+ setURI(uri);
+ }
+
+ /**
+ * Create a new input source with a character stream.
+ *
+ * <p>Application writers may use setURI() to provide a base
+ * for resolving relative URIs, and setPublicId to include a
+ * public identifier.</p>
+ *
+ * <p>The character stream shall not include a byte order mark.</p>
+ *
+ * @see #setURI
+ * @see #setByteStream
+ * @see #setCharacterStream
+ */
+ public InputSource(Reader characterStream) {
+ setCharacterStream(characterStream);
+ }
+
+ /**
+ * Set the URI for this input source.
+ *
+ * <p>The URI is optional if there is a byte stream or a character stream,
+ * but it is still useful to provide one, since the application can use it
+ * to resolve relative URIs and can include it in error messages and
+ * warnings (the parser will attempt to open a connection to the URI only
+ * if there is no byte stream or character stream specified).</p>
+ *
+ * <p>If the application knows the character encoding of the
+ * object pointed to by the URI, it can register
+ * the encoding using the setEncoding method.</p>
+ *
+ * <p>The URI must be fully resolved.</p>
+ *
+ * @param uri The URI as a string.
+ * @see #setEncoding
+ * @see #getURI
+ * @see Locator#getURI
+ * @see CSSParseException#getURI
+ */
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ /**
+ * Get the URI for this input source.
+ *
+ * <p>The getEncoding method will return the character encoding
+ * of the object pointed to, or null if unknown.</p>
+ *
+ * <p>The URI will be fully resolved.</p>
+ *
+ * @return The URI.
+ * @see #setURI
+ * @see #getEncoding
+ */
+ public String getURI() {
+ return uri;
+ }
+
+ /**
+ * Set the byte stream for this input source.
+ *
+ * <p>The SAX parser will ignore this if there is also a character
+ * stream specified, but it will use a byte stream in preference
+ * to opening a URI connection itself.</p>
+ *
+ * <p>If the application knows the character encoding of the
+ * byte stream, it should set it with the setEncoding method.</p>
+ *
+ * @param byteStream A byte stream containing an CSS document or
+ * other entity.
+ * @see #setEncoding
+ * @see #getByteStream
+ * @see #getEncoding
+ */
+ public void setByteStream(InputStream byteStream) {
+ this.byteStream = byteStream;
+ }
+
+ /**
+ * Get the byte stream for this input source.
+ *
+ * <p>The getEncoding method will return the character
+ * encoding for this byte stream, or null if unknown.</p>
+ *
+ * @return The byte stream, or null if none was supplied.
+ * @see #getEncoding
+ * @see #setByteStream
+ */
+ public InputStream getByteStream() {
+ return byteStream;
+ }
+
+ /**
+ * Set the character encoding, if known.
+ *
+ * <p>The encoding must be a string acceptable for an
+ * CHARSET encoding declaration (see section 4.4 of the CSS
+ * recommendation Level 2).</p>
+ *
+ * <p>This method has no effect when the application provides a
+ * character stream.</p>
+ *
+ * @param encoding A string describing the character encoding.
+ * @see #setURI
+ * @see #setByteStream
+ * @see #getEncoding
+ */
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ /**
+ * Get the character encoding for a byte stream or URI.
+ *
+ * @return The encoding, or null if none was supplied.
+ * @see #setByteStream
+ * @see #getURI
+ * @see #getByteStream
+ */
+ public String getEncoding() {
+ return encoding;
+ }
+
+ /**
+ * Set the character stream for this input source.
+ *
+ * <p>If there is a character stream specified, the SAX parser
+ * will ignore any byte stream and will not attempt to open
+ * a URI connection to the URI.</p>
+ *
+ * @param characterStream The character stream containing the
+ * CSS document or other entity.
+ * @see #getCharacterStream
+ */
+ public void setCharacterStream(Reader characterStream) {
+ this.characterStream = characterStream;
+ }
+
+ /**
+ * Get the character stream for this input source.
+ *
+ * @return The character stream, or null if none was supplied.
+ * @see #setCharacterStream
+ */
+ public Reader getCharacterStream() {
+ return characterStream;
+ }
+
+ /**
+ * Set the title for this input source.
+ * @param title The advisory title. See the title attribute definition
+ * for the <a href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK">LINK</A>
+ * element in HTML 4.0, and the title pseudo-attribute for the XML
+ * style sheet processing instruction.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * Returns the title for this input source.
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Set the media for this input source.
+ * @param media A comma separated list with all media.
+ */
+ public void setMedia(String media) {
+ this.media = media;
+ }
+
+ /**
+ * Returns the media associated to the input source or <code>null</code>
+ * if media are currently unknown.
+ * @return the media associated to this input source.
+ */
+ public String getMedia() {
+ if (media == null) {
+ return "all";
+ }
+ return media;
+ }
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/InputSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LangCondition.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LangCondition.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LangCondition.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LangCondition.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,21 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: LangCondition.java,v 1.1 1999/09/26 09:54:37 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.1 $
+ * @author Philippe Le Hegaret
+ * @see Condition#SAC_LANG_CONDITION
+ */
+public interface LangCondition extends Condition {
+ /**
+ * Returns the language
+ */
+ public String getLang();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LangCondition.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LexicalUnit.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LexicalUnit.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LexicalUnit.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LexicalUnit.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: LexicalUnit.java,v 1.9 2000/03/08 20:55:33 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * This is a lexical unit for CSS values.
+ * <p><b>Remarks</b>: Not all the following lexical units are supported (or
+ * will be supported) by CSS.
+ * <p>All examples are CSS2 compliant.
+ *
+ * @version $Revision: 1.9 $
+ * @author Philippe Le Hegaret
+ */
+public interface LexicalUnit {
+
+ /**
+ * ,
+ */
+ public static final short SAC_OPERATOR_COMMA = 0;
+ /**
+ * +
+ */
+ public static final short SAC_OPERATOR_PLUS = 1;
+ /**
+ * -
+ */
+ public static final short SAC_OPERATOR_MINUS = 2;
+ /**
+ * *
+ */
+ public static final short SAC_OPERATOR_MULTIPLY = 3;
+ /**
+ * /
+ */
+ public static final short SAC_OPERATOR_SLASH = 4;
+ /**
+ * %
+ */
+ public static final short SAC_OPERATOR_MOD = 5;
+ /**
+ * ^
+ */
+ public static final short SAC_OPERATOR_EXP = 6;
+ /**
+ * <
+ */
+ public static final short SAC_OPERATOR_LT = 7;
+ /**
+ * >
+ */
+ public static final short SAC_OPERATOR_GT = 8;
+ /**
+ * <=
+ */
+ public static final short SAC_OPERATOR_LE = 9;
+ /**
+ * >=
+ */
+ public static final short SAC_OPERATOR_GE = 10;
+ /**
+ * ~
+ */
+ public static final short SAC_OPERATOR_TILDE = 11;
+
+ /**
+ * identifier <code>inherit</code>.
+ */
+ public static final short SAC_INHERIT = 12;
+ /**
+ * Integers.
+ * @see #getIntegerValue
+ */
+ public static final short SAC_INTEGER = 13;
+ /**
+ * reals.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_REAL = 14;
+ /**
+ * Relative length<code>em</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_EM = 15;
+ /**
+ * Relative length<code>ex</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_EX = 16;
+ /**
+ * Relative length <code>px</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_PIXEL = 17;
+ /**
+ * Absolute length <code>in</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_INCH = 18;
+ /**
+ * Absolute length <code>cm</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_CENTIMETER = 19;
+ /**
+ * Absolute length <code>mm</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_MILLIMETER = 20;
+ /**
+ * Absolute length <code>pt</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_POINT = 21;
+ /**
+ * Absolute length <code>pc</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_PICA = 22;
+ /**
+ * Percentage.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_PERCENTAGE = 23;
+ /**
+ * URI: <code>uri(...)</code>.
+ * @see #getStringValue
+ */
+ public static final short SAC_URI = 24;
+ /**
+ * function <code>counter</code>.
+ * @see #getFunctionName
+ * @see #getParameters
+ */
+ public static final short SAC_COUNTER_FUNCTION = 25;
+ /**
+ * function <code>counters</code>.
+ * @see #getFunctionName
+ * @see #getParameters
+ */
+ public static final short SAC_COUNTERS_FUNCTION = 26;
+ /**
+ * RGB Colors.
+ * <code>rgb(0, 0, 0)</code> and <code>#000</code>
+ * @see #getFunctionName
+ * @see #getParameters
+ */
+ public static final short SAC_RGBCOLOR = 27;
+ /**
+ * Angle <code>deg</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_DEGREE = 28;
+ /**
+ * Angle <code>grad</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_GRADIAN = 29;
+ /**
+ * Angle <code>rad</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_RADIAN = 30;
+ /**
+ * Time <code>ms</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_MILLISECOND = 31;
+ /**
+ * Time <code>s</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_SECOND = 32;
+ /**
+ * Frequency <code>Hz</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_HERTZ = 33;
+ /**
+ * Frequency <code>kHz</code>.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_KILOHERTZ = 34;
+
+ /**
+ * any identifier except <code>inherit</code>.
+ * @see #getStringValue
+ */
+ public static final short SAC_IDENT = 35;
+ /**
+ * A string.
+ * @see #getStringValue
+ */
+ public static final short SAC_STRING_VALUE = 36;
+ /**
+ * Attribute: <code>attr(...)</code>.
+ * @see #getStringValue
+ */
+ public static final short SAC_ATTR = 37;
+ /**
+ * function <code>rect</code>.
+ * @see #getFunctionName
+ * @see #getParameters
+ */
+ public static final short SAC_RECT_FUNCTION = 38;
+ /**
+ * A unicode range. @@TO BE DEFINED
+ */
+ public static final short SAC_UNICODERANGE = 39;
+
+ /**
+ * sub expressions
+ * <code>(a)</code> <code>(a + b)</code> <code>(normal/none)</code>
+ * @see #getSubValues
+ */
+ public static final short SAC_SUB_EXPRESSION = 40;
+
+ /**
+ * unknown function.
+ * @see #getFunctionName
+ * @see #getParameters
+ */
+ public static final short SAC_FUNCTION = 41;
+ /**
+ * unknown dimension.
+ * @see #getFloatValue
+ * @see #getDimensionUnitText
+ */
+ public static final short SAC_DIMENSION = 42;
+
+ /**
+ * An integer indicating the type of <code>LexicalUnit</code>.
+ */
+ public short getLexicalUnitType();
+
+ /**
+ * Returns the next value or <code>null</code> if any.
+ */
+ public LexicalUnit getNextLexicalUnit();
+
+ /**
+ * Returns the previous value or <code>null</code> if any.
+ */
+ public LexicalUnit getPreviousLexicalUnit();
+
+ /**
+ * Returns the integer value.
+ * @see #SAC_INTEGER
+ */
+ public int getIntegerValue();
+
+
+ /**
+ * Returns the float value.
+ * <p>If the type of <code>LexicalUnit</code> is one of SAC_DEGREE,
+ * SAC_GRADIAN, SAC_RADIAN, SAC_MILLISECOND, SAC_SECOND, SAC_HERTZ
+ * or SAC_KILOHERTZ, the value can never be negative.</p>
+ *
+ * @see #SAC_REAL
+ * @see #SAC_DIMENSION
+ * @see #SAC_EM
+ * @see #SAC_EX
+ * @see #SAC_PIXEL
+ * @see #SAC_INCH
+ * @see #SAC_CENTIMETER
+ * @see #SAC_MILLIMETER
+ * @see #SAC_POINT
+ * @see #SAC_PICA
+ * @see #SAC_PERCENTAGE
+ * @see #SAC_DEGREE
+ * @see #SAC_GRADIAN
+ * @see #SAC_RADIAN
+ * @see #SAC_MILLISECOND
+ * @see #SAC_SECOND
+ * @see #SAC_HERTZ
+ * @see #SAC_KILOHERTZ
+ */
+ public float getFloatValue();
+
+ /**
+ * Returns the string representation of the unit.
+ * <p>if this lexical unit represents a float, the dimension is an empty
+ * string.</p>
+ * @see #SAC_REAL
+ * @see #SAC_DIMENSION
+ * @see #SAC_EM
+ * @see #SAC_EX
+ * @see #SAC_PIXEL
+ * @see #SAC_INCH
+ * @see #SAC_CENTIMETER
+ * @see #SAC_MILLIMETER
+ * @see #SAC_POINT
+ * @see #SAC_PICA
+ * @see #SAC_PERCENTAGE
+ * @see #SAC_DEGREE
+ * @see #SAC_GRADIAN
+ * @see #SAC_RADIAN
+ * @see #SAC_MILLISECOND
+ * @see #SAC_SECOND
+ * @see #SAC_HERTZ
+ * @see #SAC_KILOHERTZ
+ */
+ public String getDimensionUnitText();
+
+ /**
+ * Returns the name of the function.
+ * @see #SAC_COUNTER_FUNCTION
+ * @see #SAC_COUNTERS_FUNCTION
+ * @see #SAC_RECT_FUNCTION
+ * @see #SAC_FUNCTION
+ * @see #SAC_RGBCOLOR
+ */
+ public String getFunctionName();
+
+ /**
+ * The function parameters including operators (like the comma).
+ * <code>#000</code> is converted to <code>rgb(0, 0, 0)</code>
+ * can return <code>null</code> if <code>SAC_FUNCTION</code>.
+ * @see #SAC_COUNTER_FUNCTION
+ * @see #SAC_COUNTERS_FUNCTION
+ * @see #SAC_RECT_FUNCTION
+ * @see #SAC_FUNCTION
+ * @see #SAC_RGBCOLOR
+ */
+ public LexicalUnit getParameters();
+
+ /**
+ * Returns the string value.
+ * <p>If the type is <code>SAC_URI</code>, the return value doesn't contain
+ * <code>uri(....)</code> or quotes.
+ * <p>If the type is <code>SAC_ATTR</code>, the return value doesn't contain
+ * <code>attr(....)</code>.
+ *
+ * @see #SAC_URI
+ * @see #SAC_ATTR
+ * @see #SAC_IDENT
+ * @see #SAC_STRING_VALUE
+ * @see #SAC_UNICODERANGE @@TO BE DEFINED
+ */
+ public String getStringValue();
+
+ /**
+ * Returns a list of values inside the sub expression.
+ * @see #SAC_SUB_EXPRESSION
+ */
+ public LexicalUnit getSubValues();
+
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/LexicalUnit.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Locator.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Locator.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Locator.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Locator.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * The original version of this interface comes from SAX :
+ * http://www.megginson.com/SAX/
+ *
+ * $Id: Locator.java,v 1.1 1999/09/26 09:58:46 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * Interface for associating a CSS event with a document location.
+ *
+ * <p>If a SAX parser provides location information to the SAX
+ * application, it does so by implementing this interface and then
+ * passing an instance to the application using the document
+ * handler's setDocumentLocator method. The application can use the
+ * object to obtain the location of any other document handler event
+ * in the CSS source document.</p>
+ *
+ * <p>Note that the results returned by the object will be valid only
+ * during the scope of each document handler method: the application
+ * will receive unpredictable results if it attempts to use the
+ * locator at any other time.</p>
+ *
+ * <p>CSS parsers are not required to supply a locator, but they are
+ * very strong encouraged to do so. If the parser supplies a
+ * locator, it must do so before reporting any other document events.
+ * If no locator has been set by the time the application receives
+ * the startDocument event, the application should assume that a
+ * locator is not available.</p>
+ *
+ * @version $Revision: 1.1 $
+ * @author Philippe Le Hegaret
+ */
+public interface Locator {
+
+ /**
+ * Return the URI for the current document event.
+ *
+ * <p>The parser must resolve the URI fully before passing it to the
+ * application.</p>
+ *
+ * @return A string containing the URI, or null
+ * if none is available.
+ */
+ public String getURI();
+
+ /**
+ * Return the line number where the current document event ends.
+ * Note that this is the line position of the first character
+ * after the text associated with the document event.
+ * @return The line number, or -1 if none is available.
+ * @see #getColumnNumber
+ */
+ public int getLineNumber();
+
+ /**
+ * Return the column number where the current document event ends.
+ * Note that this is the column number of the first
+ * character after the text associated with the document
+ * event. The first column in a line is position 1.
+ * @return The column number, or -1 if none is available.
+ * @see #getLineNumber
+ */
+ public int getColumnNumber();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Locator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeCondition.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeCondition.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeCondition.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeCondition.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,22 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: NegativeCondition.java,v 1.2 1999/09/26 10:15:58 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret
+ * @see Condition#SAC_NEGATIVE_CONDITION
+ */
+public interface NegativeCondition extends Condition {
+
+ /**
+ * Returns the condition.
+ */
+ public Condition getCondition();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeCondition.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeSelector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeSelector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeSelector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeSelector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,22 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: NegativeSelector.java,v 1.2 1999/09/25 12:32:36 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret
+ * @see Selector#SAC_NEGATIVE_SELECTOR
+ */
+public interface NegativeSelector extends SimpleSelector {
+
+ /**
+ * Returns the simple selector.
+ */
+ public SimpleSelector getSimpleSelector();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/NegativeSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Parser.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Parser.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Parser.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Parser.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * The original version of this interface comes from SAX :
+ * http://www.megginson.com/SAX/
+ *
+ * $Id: Parser.java,v 1.13 2000/10/27 20:45:21 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+import java.io.IOException;
+import java.util.Locale;
+
+/**
+ * Basic interface for CSS (Simple API for CSS) parsers.
+ *
+ * <p>All CSS parsers must implement this basic interface: it allows
+ * applications to register handlers for different types of events
+ * and to initiate a parse from a URI, or a character stream.</p>
+ *
+ * <p>All CSS parsers must also implement a zero-argument constructor
+ * (though other constructors are also allowed).</p>
+ *
+ * <p>CSS parsers are reusable but not re-entrant: the application
+ * may reuse a parser object (possibly with a different input source)
+ * once the first parse has completed successfully, but it may not
+ * invoke the parse() methods recursively within a parse.</p>
+ *
+ * @version $Revision: 1.13 $
+ * @author Philippe Le Hegaret
+ * @see DocumentHandler
+ * @see ErrorHandler
+ * @see InputSource
+ */
+public interface Parser {
+
+ /**
+ * Allow an application to request a locale for errors and warnings.
+ *
+ * <p>CSS parsers are not required to provide localisation for errors
+ * and warnings; if they cannot support the requested locale,
+ * however, they must throw a CSS exception. Applications may
+ * not request a locale change in the middle of a parse.</p>
+ *
+ * @param locale A Java Locale object.
+ * @exception CSSException Throws an exception
+ * (using the previous or default locale) if the
+ * requested locale is not supported.
+ * @see CSSException
+ * @see CSSParseException
+ */
+ public void setLocale(Locale locale) throws CSSException;
+
+ /**
+ * Allow an application to register a document event handler.
+ *
+ * <p>If the application does not register a document handler, all
+ * document events reported by the CSS parser will be silently
+ * ignored (this is the default behaviour implemented by
+ * HandlerBase).</p>
+ *
+ * <p>Applications may register a new or different handler in the
+ * middle of a parse, and the CSS parser must begin using the new
+ * handler immediately.</p>
+ *
+ * @param handler The document handler.
+ * @see DocumentHandler
+ */
+ public void setDocumentHandler(DocumentHandler handler);
+
+ public void setSelectorFactory(SelectorFactory selectorFactory);
+ public void setConditionFactory(ConditionFactory conditionFactory);
+
+ /**
+ * Allow an application to register an error event handler.
+ *
+ * <p>If the application does not register an error event handler,
+ * all error events reported by the CSS parser will be silently
+ * ignored, except for fatalError, which will throw a CSSException
+ * (this is the default behaviour implemented by HandlerBase).</p>
+ *
+ * <p>Applications may register a new or different handler in the
+ * middle of a parse, and the CSS parser must begin using the new
+ * handler immediately.</p>
+ *
+ * @param handler The error handler.
+ * @see ErrorHandler
+ * @see CSSException
+ */
+ public void setErrorHandler(ErrorHandler handler);
+
+ /**
+ * Parse a CSS document.
+ *
+ * <p>The application can use this method to instruct the CSS parser
+ * to begin parsing an CSS document from any valid input
+ * source (a character stream, a byte stream, or a URI).</p>
+ *
+ * <p>Applications may not invoke this method while a parse is in
+ * progress (they should create a new Parser instead for each
+ * additional CSS document). Once a parse is complete, an
+ * application may reuse the same Parser object, possibly with a
+ * different input source.</p>
+ *
+ * @param source The input source for the top-level of the
+ * CSS document.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ * @see InputSource
+ * @see #parseStyleSheet(java.lang.String)
+ * @see #setDocumentHandler
+ * @see #setErrorHandler
+ */
+ public void parseStyleSheet(InputSource source)
+ throws CSSException, IOException;
+
+
+ /**
+ * Parse a CSS document from a URI.
+ *
+ * <p>This method is a shortcut for the common case of reading a document
+ * from a URI. It is the exact equivalent of the following:</p>
+ *
+ * <pre>
+ * parse(new InputSource(uri));
+ * </pre>
+ *
+ * <p>The URI must be fully resolved by the application before it is passed
+ * to the parser.</p>
+ *
+ * @param uri The URI.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ * @see #parseStyleSheet(InputSource)
+ */
+ public void parseStyleSheet(String uri) throws CSSException, IOException;
+
+ /**
+ * Parse a CSS style declaration (without '{' and '}').
+ *
+ * @param styleValue The declaration.
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ */
+ public void parseStyleDeclaration(InputSource source)
+ throws CSSException, IOException;
+
+
+ /**
+ * Parse a CSS rule.
+ *
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ */
+ public void parseRule(InputSource source) throws CSSException, IOException;
+
+ /**
+ * Returns a string about which CSS language is supported by this
+ * parser. For CSS Level 1, it returns "http://www.w3.org/TR/REC-CSS1", for
+ * CSS Level 2, it returns "http://www.w3.org/TR/REC-CSS2". Note that a
+ * "CSSx" parser can return lexical unit other than those allowed by CSS
+ * Level x but this usage is not recommended.
+ */
+ public String getParserVersion();
+
+ /**
+ * Parse a comma separated list of selectors.
+ *
+ *
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ */
+ public SelectorList parseSelectors(InputSource source)
+ throws CSSException, IOException;
+
+
+ /**
+ * Parse a CSS property value.
+ *
+ *
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ */
+ public LexicalUnit parsePropertyValue(InputSource source)
+ throws CSSException, IOException;
+
+
+ /**
+ * Parse a CSS priority value (e.g. "!important").
+ *
+ *
+ * @exception CSSException Any CSS exception, possibly
+ * wrapping another exception.
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ */
+ public boolean parsePriority(InputSource source)
+ throws CSSException, IOException;
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Parser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/PositionalCondition.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/PositionalCondition.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/PositionalCondition.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/PositionalCondition.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,36 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: PositionalCondition.java,v 1.4 2000/02/14 15:54:12 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.4 $
+ * @author Philippe Le Hegaret
+ * @see Condition#SAC_POSITIONAL_CONDITION
+ */
+public interface PositionalCondition extends Condition {
+
+ /**
+ * Returns the position in the tree.
+ * <p>A negative value means from the end of the child node list.
+ * <p>The child node list begins at 0.
+ */
+ public int getPosition();
+
+ /**
+ * <code>true</code> if the child node list only shows nodes of the same
+ * type of the selector (only elements, only PIS, ...)
+ */
+ public boolean getTypeNode();
+
+ /**
+ * <code>true</code> if the node should have the same node type (for
+ * element, same namespaceURI and same localName).
+ */
+ public boolean getType();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/PositionalCondition.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ProcessingInstructionSelector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ProcessingInstructionSelector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ProcessingInstructionSelector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ProcessingInstructionSelector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,31 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: ProcessingInstructionSelector.java,v 1.2 1999/09/25 12:32:36 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * This simple matches a
+ * <a href="http://www.w3.org/TR/REC-xml#sec-pi">processing instruction</a>.
+ *
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret
+ * @see Selector#SAC_PROCESSING_INSTRUCTION_NODE_SELECTOR
+ */
+public interface ProcessingInstructionSelector extends SimpleSelector {
+
+ /**
+ * Returns the <a href="http://www.w3.org/TR/REC-xml#NT-PITarget">target</a>
+ * of the processing instruction.
+ */
+ public String getTarget();
+
+ /**
+ * Returns the character data.
+ */
+ public String getData();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/ProcessingInstructionSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SACMediaList.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SACMediaList.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SACMediaList.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SACMediaList.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,27 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: SACMediaList.java,v 1.1 2000/02/16 21:27:32 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.1 $
+ * @author Philippe Le Hegaret
+ */
+public interface SACMediaList {
+
+ /**
+ * Returns the length of this media list
+ */
+ public int getLength();
+
+ /**
+ * Returns the medium at the specified index, or <code>null</code> if this
+ * is not a valid index.
+ */
+ public String item(int index);
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SACMediaList.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Selector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Selector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Selector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Selector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ *
+ * $Id: Selector.java,v 1.12 2000/07/15 22:08:45 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * This interface defines a selector.
+ * <p><b>Remarks</b>: Not all the following selectors are supported (or will be
+ * supported) by CSS.
+ * <p>All examples are CSS2 compliant.
+ *
+ * @version $Revision: 1.12 $
+ * @author Philippe Le Hegaret
+ */
+public interface Selector {
+
+ /* simple selectors */
+
+ /**
+ * This is a conditional selector.
+ * example:
+ * <pre class="example">
+ * simple[role="private"]
+ * .part1
+ * H1#myId
+ * P:lang(fr).p1
+ * </pre>
+ *
+ * @see ConditionalSelector
+ */
+ public static final short SAC_CONDITIONAL_SELECTOR = 0;
+
+ /**
+ * This selector matches any node.
+ * @see SimpleSelector
+ */
+ public static final short SAC_ANY_NODE_SELECTOR = 1;
+
+ /**
+ * This selector matches the root node.
+ * @see SimpleSelector
+ */
+ public static final short SAC_ROOT_NODE_SELECTOR = 2;
+
+ /**
+ * This selector matches only node that are different from a specified one.
+ * @see NegativeSelector
+ */
+ public static final short SAC_NEGATIVE_SELECTOR = 3;
+
+ /**
+ * This selector matches only element node.
+ * example:
+ * <pre class="example">
+ * H1
+ * animate
+ * </pre>
+ * @see ElementSelector
+ */
+ public static final short SAC_ELEMENT_NODE_SELECTOR = 4;
+
+ /**
+ * This selector matches only text node.
+ * @see CharacterDataSelector
+ */
+ public static final short SAC_TEXT_NODE_SELECTOR = 5;
+
+ /**
+ * This selector matches only cdata node.
+ * @see CharacterDataSelector
+ */
+ public static final short SAC_CDATA_SECTION_NODE_SELECTOR = 6;
+
+ /**
+ * This selector matches only processing instruction node.
+ * @see ProcessingInstructionSelector
+ */
+ public static final short SAC_PROCESSING_INSTRUCTION_NODE_SELECTOR = 7;
+
+ /**
+ * This selector matches only comment node.
+ * @see CharacterDataSelector
+ */
+ public static final short SAC_COMMENT_NODE_SELECTOR = 8;
+ /**
+ * This selector matches the 'first line' pseudo element.
+ * example:
+ * <pre class="example">
+ * :first-line
+ * </pre>
+ * @see ElementSelector
+ */
+ public static final short SAC_PSEUDO_ELEMENT_SELECTOR = 9;
+
+ /* combinator selectors */
+
+ /**
+ * This selector matches an arbitrary descendant of some ancestor element.
+ * example:
+ * <pre class="example">
+ * E F
+ * </pre>
+ * @see DescendantSelector
+ */
+ public static final short SAC_DESCENDANT_SELECTOR = 10;
+
+ /**
+ * This selector matches a childhood relationship between two elements.
+ * example:
+ * <pre class="example">
+ * E > F
+ * </pre>
+ * @see DescendantSelector
+ */
+ public static final short SAC_CHILD_SELECTOR = 11;
+ /**
+ * This selector matches two selectors who shared the same parent in the
+ * document tree and the element represented by the first sequence
+ * immediately precedes the element represented by the second one.
+ * example:
+ * <pre class="example">
+ * E + F
+ * </pre>
+ * @see SiblingSelector
+ */
+ public static final short SAC_DIRECT_ADJACENT_SELECTOR = 12;
+
+ /**
+ * An integer indicating the type of <code>Selector</code>
+ */
+ public short getSelectorType();
+
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/Selector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorFactory.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorFactory.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorFactory.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorFactory.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ *
+ * $Id: SelectorFactory.java,v 1.3 2000/07/27 21:19:21 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.3 $
+ * @author Philippe Le Hegaret
+ * @see org.w3c.css.sac.Selector
+ */
+public interface SelectorFactory {
+
+ /**
+ * Creates a conditional selector.
+ *
+ * @param selector a selector.
+ * @param condition a condition
+ * @return the conditional selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ ConditionalSelector createConditionalSelector(SimpleSelector selector,
+ Condition condition)
+ throws CSSException;
+
+ /**
+ * Creates an any node selector.
+ *
+ * @return the any node selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ SimpleSelector createAnyNodeSelector() throws CSSException;
+
+ /**
+ * Creates an root node selector.
+ *
+ * @return the root node selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ SimpleSelector createRootNodeSelector() throws CSSException;
+
+ /**
+ * Creates an negative selector.
+ *
+ * @param selector a selector.
+ * @return the negative selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ NegativeSelector createNegativeSelector(SimpleSelector selector)
+ throws CSSException;
+
+ /**
+ * Creates an element selector.
+ *
+ * @param namespaceURI the <a href="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace
+ * URI</a> of the element selector.
+ * @param tagName the <a href="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local
+ * part</a> of the element name. <code>NULL</code> if this element
+ * selector can match any element.</p>
+ * @return the element selector
+ * @exception CSSException If this selector is not supported.
+ */
+ ElementSelector createElementSelector(String namespaceURI, String tagName)
+ throws CSSException;
+
+ /**
+ * Creates a text node selector.
+ *
+ * @param data the data
+ * @return the text node selector
+ * @exception CSSException If this selector is not supported.
+ */
+ CharacterDataSelector createTextNodeSelector(String data)
+ throws CSSException;
+
+ /**
+ * Creates a cdata section node selector.
+ *
+ * @param data the data
+ * @return the cdata section node selector
+ * @exception CSSException If this selector is not supported.
+ */
+ CharacterDataSelector createCDataSectionSelector(String data)
+ throws CSSException;
+
+ /**
+ * Creates a processing instruction node selector.
+ *
+ * @param target the target
+ * @param data the data
+ * @return the processing instruction node selector
+ * @exception CSSException If this selector is not supported.
+ */
+ ProcessingInstructionSelector
+ createProcessingInstructionSelector(String target,
+ String data)
+ throws CSSException;
+
+ /**
+ * Creates a comment node selector.
+ *
+ * @param data the data
+ * @return the comment node selector
+ * @exception CSSException If this selector is not supported.
+ */
+ CharacterDataSelector createCommentSelector(String data)
+ throws CSSException;
+
+ /**
+ * Creates a pseudo element selector.
+ *
+ * @param pseudoName the pseudo element name. <code>NULL</code> if this
+ * element selector can match any pseudo element.</p>
+ * @return the element selector
+ * @exception CSSException If this selector is not supported.
+ */
+ ElementSelector createPseudoElementSelector(String namespaceURI,
+ String pseudoName)
+ throws CSSException;
+
+ /**
+ * Creates a descendant selector.
+ *
+ * @param parent the parent selector
+ * @param descendant the descendant selector
+ * @return the combinator selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ DescendantSelector createDescendantSelector(Selector parent,
+ SimpleSelector descendant)
+ throws CSSException;
+
+ /**
+ * Creates a child selector.
+ *
+ * @param parent the parent selector
+ * @param child the child selector
+ * @return the combinator selector.
+ * @exception CSSException If this selector is not supported.
+ */
+ DescendantSelector createChildSelector(Selector parent,
+ SimpleSelector child)
+ throws CSSException;
+
+ /**
+ * Creates a sibling selector.
+ *
+ * @param nodeType the type of nodes in the siblings list.
+ * @param child the child selector
+ * @param adjacent the direct adjacent selector
+ * @return the sibling selector with nodeType
+ equals to org.w3c.dom.Node.ELEMENT_NODE
+ * @exception CSSException If this selector is not supported.
+ */
+ SiblingSelector createDirectAdjacentSelector(short nodeType,
+ Selector child,
+ SimpleSelector directAdjacent)
+ throws CSSException;
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorList.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorList.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorList.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorList.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: SelectorList.java,v 1.1 1999/09/26 10:06:45 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * The SelectorList interface provides the abstraction of an ordered collection
+ * of selectors, without defining or constraining how this collection is
+ * implemented.
+ *
+ * @version $Revision: 1.1 $
+ * @author Philippe Le Hegaret
+ */
+public interface SelectorList {
+
+ /**
+ * Returns the length of this selector list
+ */
+ public int getLength();
+
+ /**
+ * Returns the selector at the specified index, or <code>null</code> if this
+ * is not a valid index.
+ */
+ public Selector item(int index);
+}
+
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SelectorList.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SiblingSelector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SiblingSelector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SiblingSelector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SiblingSelector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,36 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: SiblingSelector.java,v 1.3 2000/07/27 21:19:21 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * @version $Revision: 1.3 $
+ * @author Philippe Le Hegaret
+ * @see Selector#SAC_DIRECT_ADJACENT_SELECTOR
+ */
+public interface SiblingSelector extends Selector {
+
+ public static final short ANY_NODE = 201;
+
+ /**
+ * The node type to considered in the siblings list.
+ * All DOM node types are supported. In order to support the "any" node
+ * type, the code ANY_NODE is added to the DOM node types.
+ */
+ public short getNodeType();
+
+ /**
+ * Returns the first selector.
+ */
+ public Selector getSelector();
+
+ /*
+ * Returns the second selector.
+ */
+ public SimpleSelector getSiblingSelector();
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SiblingSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SimpleSelector.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SimpleSelector.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SimpleSelector.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SimpleSelector.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,21 @@
+/*
+ * (c) COPYRIGHT 1999 World Wide Web Consortium
+ * (Massachusetts Institute of Technology, Institut National de Recherche
+ * en Informatique et en Automatique, Keio University).
+ * All Rights Reserved. http://www.w3.org/Consortium/Legal/
+ *
+ * $Id: SimpleSelector.java,v 1.2 1999/09/30 16:54:22 plehegar Exp $
+ */
+package org.w3c.css.sac;
+
+/**
+ * This interface is only for constraints on selectors.
+ *
+ * <p>A <code>ConditionalSelector</code> can only accept a simple selector or a
+ * negative selector.</p>
+ *
+ * @version $Revision: 1.2 $
+ * @author Philippe Le Hegaret */
+public interface SimpleSelector extends Selector {
+ // empty
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/SimpleSelector.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/helpers/ParserFactory.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/helpers/ParserFactory.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/helpers/ParserFactory.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/helpers/ParserFactory.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ *
+ * $Id: ParserFactory.java,v 1.1 2000/02/14 15:54:49 plehegar Exp $
+ */
+package org.w3c.css.sac.helpers;
+
+import org.w3c.css.sac.Parser;
+
+/**
+ * @version $Revision: 1.1 $
+ * @author Philippe Le Hegaret
+ */
+public class ParserFactory {
+
+ /**
+ * Create a parser with given selectors factory and conditions factory.
+ */
+ public Parser makeParser()
+ throws ClassNotFoundException,
+ IllegalAccessException,
+ InstantiationException,
+ NullPointerException,
+ ClassCastException {
+ String className = System.getProperty("org.w3c.css.sac.parser");
+ if (className == null) {
+ throw new NullPointerException("No value for sac.parser property");
+ } else {
+ return (Parser)(Class.forName(className).newInstance());
+ }
+ }
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/css/sac/helpers/ParserFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/CustomEvent.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/CustomEvent.java?rev=374855&view=auto
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/CustomEvent.java (added)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/CustomEvent.java Sat Feb 4 02:10:57 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2003 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
+
+package org.w3c.dom.events;
+
+/**
+ * The <code>CustomEvent</code> interface gives access to the attributes
+ * <code>Event.currentTarget</code> and <code>Event.eventPhase</code>. It is
+ * intended to be used by the DOM Events implementation to access the
+ * underlying current target and event phase while dispatching a custom
+ * <code>Event</code> in the tree; it is also intended to be implemented,
+ * and <em>not used</em>, by DOM applications.
+ * <p> The methods contained in this interface are not intended to be used by
+ * a DOM application, especially during the dispatch on the
+ * <code>Event</code> object. Changing the current target or the current
+ * phase may result in unpredictable results of the event flow. The DOM
+ * Events implementation should ensure that both methods return the
+ * appropriate current target and phase before invoking each event listener
+ * on the current target to protect DOM applications from malicious event
+ * listeners.
+ * <p ><b>Note:</b> If this interface is supported by the event object,
+ * <code>Event.isCustom()</code> must return <code>true</code>.
+ * <p>See also the <a href='http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107'>Document Object Model (DOM) Level 3 Events Specification</a>.
+ * @since DOM Level 3
+ */
+public interface CustomEvent extends Event {
+ /**
+ * The <code>setDispatchState</code> method is used by the DOM Events
+ * implementation to set the values of <code>Event.currentTarget</code>
+ * and <code>Event.eventPhase</code>. It also reset the states of
+ * <code>isPropagationStopped</code> and
+ * <code>isImmediatePropagationStopped</code>.
+ * @param target Specifies the new value for the
+ * <code>Event.currentTarget</code> attribute.
+ * @param phase Specifies the new value for the
+ * <code>Event.eventPhase</code> attribute.
+ */
+ public void setDispatchState(EventTarget target,
+ short phase);
+
+ /**
+ * This method will return <code>true</code> if the method
+ * <code>stopPropagation()</code> has been called for this event,
+ * <code>false</code> in any other cases.
+ * @return <code>true</code> if the event propagation has been stopped
+ * in the current group.
+ */
+ public boolean isPropagationStopped();
+
+ /**
+ * The <code>isImmediatePropagationStopped</code> method is used by the
+ * DOM Events implementation to know if the method
+ * <code>stopImmediatePropagation()</code> has been called for this
+ * event. It returns <code>true</code> if the method has been called,
+ * <code>false</code> otherwise.
+ * @return <code>true</code> if the event propagation has been stopped
+ * immediately in the current group.
+ */
+ public boolean isImmediatePropagationStopped();
+
+}
Propchange: xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/CustomEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/DocumentEvent.java
URL: http://svn.apache.org/viewcvs/xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/DocumentEvent.java?rev=374855&r1=374854&r2=374855&view=diff
==============================================================================
--- xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/DocumentEvent.java (original)
+++ xml/commons/branches/external-extended/java/external/src/org/w3c/dom/events/DocumentEvent.java Sat Feb 4 02:10:57 2006
@@ -1,13 +1,13 @@
/*
- * Copyright (c) 2000 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+ * Copyright (c) 2003 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
*/
package org.w3c.dom.events;
@@ -16,41 +16,71 @@
/**
* The <code>DocumentEvent</code> interface provides a mechanism by which the
- * user can create an Event of a type supported by the implementation. It is
- * expected that the <code>DocumentEvent</code> interface will be
- * implemented on the same object which implements the <code>Document</code>
- * interface in an implementation which supports the Event model.
- * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
+ * user can create an <code>Event</code> object of a type supported by the
+ * implementation. If the feature "Events" is supported by the
+ * <code>Document</code> object, the <code>DocumentEvent</code> interface
+ * must be implemented on the same object. If the feature "+Events" is
+ * supported by the <code>Document</code> object, an object that supports
+ * the <code>DocumentEvent</code> interface must be returned by invoking the
+ * method <code>Node.getFeature("+Events", "3.0")</code> on the
+ * <code>Document</code> object.
+ * <p>See also the <a href='http://www.w3.org/TR/2003/NOTE-DOM-Level-3-Events-20031107'>Document Object Model (DOM) Level 3 Events Specification</a>.
* @since DOM Level 2
*/
public interface DocumentEvent {
/**
*
- * @param eventType The <code>eventType</code> parameter specifies the
- * type of <code>Event</code> interface to be created. If the
- * <code>Event</code> interface specified is supported by the
- * implementation this method will return a new <code>Event</code> of
- * the interface type requested. If the <code>Event</code> is to be
- * dispatched via the <code>dispatchEvent</code> method the
- * appropriate event init method must be called after creation in
- * order to initialize the <code>Event</code>'s values. As an example,
- * a user wishing to synthesize some kind of <code>UIEvent</code>
- * would call <code>createEvent</code> with the parameter "UIEvents".
- * The <code>initUIEvent</code> method could then be called on the
- * newly created <code>UIEvent</code> to set the specific type of
- * UIEvent to be dispatched and set its context information.The
+ * @param eventType The <code>eventType</code> parameter specifies the
+ * name of the DOM Events interface to be supported by the created
+ * event object, e.g. <code>"Event"</code>, <code>"MouseEvent"</code>,
+ * <code>"MutationEvent"</code> and so on. If the <code>Event</code>
+ * is to be dispatched via the <code>EventTarget.dispatchEvent()</code>
+ * method the appropriate event init method must be called after
+ * creation in order to initialize the <code>Event</code>'s values.
+ * As an example, a user wishing to synthesize some kind of
+ * <code>UIEvent</code> would invoke
+ * <code>DocumentEvent.createEvent("UIEvent")</code>. The
+ * <code>UIEvent.initUIEventNS()</code> method could then be called on
+ * the newly created <code>UIEvent</code> object to set the specific
+ * type of user interface event to be dispatched,
+ * <code>{"http://www.w3.org/2001/xml-events", "DOMActivate"}</code>
+ * for example, and set its context information, e.g.
+ * <code>UIEvent.detail</code> in this example. The
* <code>createEvent</code> method is used in creating
* <code>Event</code>s when it is either inconvenient or unnecessary
* for the user to create an <code>Event</code> themselves. In cases
* where the implementation provided <code>Event</code> is
* insufficient, users may supply their own <code>Event</code>
- * implementations for use with the <code>dispatchEvent</code> method.
- * @return The newly created <code>Event</code>
+ * implementations for use with the
+ * <code>EventTarget.dispatchEvent()</code> method. However, the DOM
+ * implementation needs access to the attributes
+ * <code>Event.currentTarget</code> and <code>Event.eventPhase</code>
+ * to appropriately propagate the event in the DOM tree. Therefore
+ * users' <code>Event</code> implementations might need to support the
+ * <code>CustomEvent</code> interface for that effect.
+ * <p ><b>Note:</b> For backward compatibility reason, "UIEvents",
+ * "MouseEvents", "MutationEvents", and "HTMLEvents" feature names are
+ * valid values for the parameter <code>eventType</code> and represent
+ * respectively the interfaces "UIEvent", "MouseEvent",
+ * "MutationEvent", and "Event".
+ * @return The newly created event object.
* @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
- * type of <code>Event</code> interface requested
+ * NOT_SUPPORTED_ERR: Raised if the implementation does not support the
+ * <code>Event</code> interface requested.
*/
public Event createEvent(String eventType)
throws DOMException;
+
+ /**
+ * Test if the implementation can generate events of a specified type.
+ * @param namespaceURI Specifies the <code>Event.namespaceURI</code> of
+ * the event.
+ * @param type Specifies the <code>Event.type</code> of the event.
+ * @return <code>true</code> if the implementation can generate and
+ * dispatch this event type, <code>false</code> otherwise.
+ * @since DOM Level 3
+ */
+ public boolean canDispatch(String namespaceURI,
+ String type);
}