Skip to content

Navigation Menu

Sign in
Sign up

Deprecate HTML4-error-reporting methods/classes and update pom.xml for the 1.5 release #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sideshowbarker wants to merge 9 commits into release-1.5
base: release-1.5
Choose a base branch
Loading
from release-1.5-with-deprecated-annotations
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
9 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions pom.xml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>nu.validator.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
<packaging>bundle</packaging>
<version>1.4</version>
<version>1.5</version>
<name>htmlparser</name>
<url>http://about.validator.nu/htmlparser/</url>
<description>The Validator.nu HTML Parser is an implementation of the HTML5 parsing algorithm in Java for applications. The parser is designed to work as a drop-in replacement for the XML parser in applications that already support XHTML 1.x content with an XML parser and use SAX, DOM or XOM to interface with the parser.</description>
Expand Down Expand Up @@ -69,8 +69,8 @@
</license>
</licenses>
<scm>
<connection>scm:hg:http://hg.mozilla.org/projects/htmlparser/</connection>
<url>http://hg.mozilla.org/projects/htmlparser/</url>
<connection>scm:git:https://github.com/validator/htmlparser.git</connection>
<url>https://github.com/validator/htmlparser</url>
</scm>
<build>
<sourceDirectory>${project.build.directory}/src</sourceDirectory>
Expand All @@ -80,22 +80,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<id>intitialize-sources</id>
Expand All @@ -121,6 +112,7 @@
</goals>
<configuration>
<target>
<property name="build.compiler" value="extJavac"/>
<property name="translator.sources" value="${basedir}/translator-src"/>
<property name="translator.classes" value="${project.build.directory}/translator-classes"/>
<mkdir dir="${translator.classes}"/>
Expand Down Expand Up @@ -157,7 +149,8 @@
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>nu.validator.htmlparser</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment>
<Automatic-Module-Name>nu.validator.htmlparser</Automatic-Module-Name>
Comment thread
sideshowbarker marked this conversation as resolved.
<_removeheaders>Built-By,Bnd-LastModified</_removeheaders>
</instructions>
</configuration>
Expand Down Expand Up @@ -214,7 +207,7 @@
<dependency>
<groupId>xom</groupId>
<artifactId>xom</artifactId>
<version>1.1</version>
<version>[1.3.5,)</version>
Comment thread
sideshowbarker marked this conversation as resolved.
<scope>compile</scope>
<optional>true</optional>
</dependency>
Expand Down
1 change: 1 addition & 0 deletions src/nu/validator/htmlparser/common/DoctypeExpectation.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @version $Id$
* @author hsivonen
*/
@Deprecated
public enum DoctypeExpectation {
/**
* Be a pure HTML5 parser.
Expand Down
4 changes: 3 additions & 1 deletion src/nu/validator/htmlparser/common/DocumentModeHandler.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ public interface DocumentModeHandler {
* @param mode the document mode
* @param publicIdentifier the public id of the doctype or <code>null</code> if unavailable
* @param systemIdentifier the system id of the doctype or <code>null</code> if unavailable
* @param html4SpecificAdditionalErrorChecks <code>true</code> if HTML 4-specific checks were enabled, <code>false</code> otherwise
* @throws SAXException if things go wrong
*/
public void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier) throws SAXException;

@Deprecated
public void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws SAXException;
}
9 changes: 8 additions & 1 deletion src/nu/validator/htmlparser/dom/DOMTreeBuilder.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,15 @@ protected DOMTreeBuilder(DOMImplementation implementation) {
/**
*
* @see nu.validator.htmlparser.impl.TreeBuilder#documentMode(nu.validator.htmlparser.common.DocumentMode,
* java.lang.String, java.lang.String, boolean)
* java.lang.String, java.lang.String)
*/
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier)
throws SAXException {
document.setUserData("nu.validator.document-mode", mode, null);
}

@Deprecated
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)
throws SAXException {
Expand Down
4 changes: 4 additions & 0 deletions src/nu/validator/htmlparser/dom/HtmlDocumentBuilder.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
@Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
Expand All @@ -473,6 +474,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
@Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
Expand Down Expand Up @@ -526,6 +528,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
Expand All @@ -548,6 +551,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
Expand Down
1 change: 1 addition & 0 deletions src/nu/validator/htmlparser/impl/Tokenizer.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ public void setNamePolicy(XmlViolationPolicy namePolicy) {
* @param html4ModeCompatibleWithXhtml1Schemata
* the html4ModeCompatibleWithXhtml1Schemata to set
*/
@Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
Expand Down
1 change: 1 addition & 0 deletions src/nu/validator/htmlparser/impl/TreeBuilder.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6027,6 +6027,7 @@ public void setIsSrcdocDocument(boolean isSrcdocDocument) {
* @param doctypeExpectation
* the doctypeExpectation to set
*/
@Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
}
Expand Down
1 change: 1 addition & 0 deletions src/nu/validator/htmlparser/io/Driver.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ public void setTransitionHandler(TransitionHandler transitionHandler) {
* @param html4ModeCompatibleWithXhtml1Schemata
* @see nu.validator.htmlparser.impl.Tokenizer#setHtml4ModeCompatibleWithXhtml1Schemata(boolean)
*/
@Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
tokenizer.setHtml4ModeCompatibleWithXhtml1Schemata(html4ModeCompatibleWithXhtml1Schemata);
Expand Down
4 changes: 4 additions & 0 deletions src/nu/validator/htmlparser/sax/HtmlParser.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
@Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
Expand All @@ -828,6 +829,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
@Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
Expand Down Expand Up @@ -881,6 +883,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
Expand All @@ -903,6 +906,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
Expand Down
4 changes: 4 additions & 0 deletions src/nu/validator/htmlparser/xom/HtmlBuilder.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
@Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
Expand All @@ -510,6 +511,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
@Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
Expand Down Expand Up @@ -563,6 +565,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
Expand All @@ -585,6 +588,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
@Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
Expand Down
12 changes: 11 additions & 1 deletion src/nu/validator/htmlparser/xom/XOMTreeBuilder.java
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,19 @@ protected void start(boolean fragment) throws SAXException {

/**
* @see nu.validator.htmlparser.impl.TreeBuilder#documentMode(nu.validator.htmlparser.common.DocumentMode,
* java.lang.String, java.lang.String, boolean)
* java.lang.String, java.lang.String)
*/
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier)
throws SAXException {
if (document instanceof Mode) {
Mode modal = (Mode) document;
modal.setMode(mode);
}
}

@Override
@Deprecated
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)
throws SAXException {
Expand Down

AltStyle によって変換されたページ (->オリジナル) /