fi.iki.hsivonen.verifierservlet
Class VerifierServletTransaction
java.lang.Object
fi.iki.hsivonen.verifierservlet.VerifierServletTransaction
- All Implemented Interfaces:
- DoctypeHandler
- Direct Known Subclasses:
- Html5ConformanceCheckerTransaction
class VerifierServletTransaction
- extends Object
- implements DoctypeHandler
- Version:
- $Id: VerifierServletTransaction.java,v 1.10 2005/07/24 07:32:48
hsivonen Exp $
- Author:
- hsivonen
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log4j
private static final org.apache.log4j.Logger log4j
SPACE
private static final Pattern SPACE
NO_EXTERNAL_ENTITIES
private static final int NO_EXTERNAL_ENTITIES
- See Also:
- Constant Field Values
EXTERNAL_ENTITIES_NO_VALIDATION
private static final int EXTERNAL_ENTITIES_NO_VALIDATION
- See Also:
- Constant Field Values
HTML_PARSER
private static final int HTML_PARSER
- See Also:
- Constant Field Values
HTML_PARSER_5
private static final int HTML_PARSER_5
- See Also:
- Constant Field Values
HTML_PARSER_4_STRICT
private static final int HTML_PARSER_4_STRICT
- See Also:
- Constant Field Values
HTML_PARSER_4_TRANSITIONAL
private static final int HTML_PARSER_4_TRANSITIONAL
- See Also:
- Constant Field Values
AUTOMATIC_PARSER
private static final int AUTOMATIC_PARSER
- See Also:
- Constant Field Values
XHTML5_SCHEMA
protected static final int XHTML5_SCHEMA
- See Also:
- Constant Field Values
SERVICE_TITLE
private static final char[] SERVICE_TITLE
TWO_POINT_OH_BETA
private static final char[] TWO_POINT_OH_BETA
RESULTS_TITLE
private static final char[] RESULTS_TITLE
SUCCESS
private static final char[] SUCCESS
FAILURE
private static final char[] FAILURE
pathMap
private static final Map pathMap
presetDoctypes
private static int[] presetDoctypes
presetLabels
private static String[] presetLabels
presetUrls
private static String[] presetUrls
presetNamespaces
private static String[] presetNamespaces
KNOWN_CONTENT_TYPES
private static final String[] KNOWN_CONTENT_TYPES
NAMESPACES_FOR_KNOWN_CONTENT_TYPES
private static final String[] NAMESPACES_FOR_KNOWN_CONTENT_TYPES
ALL_CHECKERS
private static final String[] ALL_CHECKERS
ALL_CHECKERS_HTML4
private static final String[] ALL_CHECKERS_HTML4
start
private long start
request
private HttpServletRequest request
response
private HttpServletResponse response
iriFactory
private com.hp.hpl.jena.iri.IRIFactory iriFactory
document
protected String document
parser
private int parser
laxType
private boolean laxType
contentHandler
protected ContentHandler contentHandler
emitter
protected XhtmlSaxEmitter emitter
errorHandler
protected XhtmlEmittingErrorHandler errorHandler
attrs
private AttributesImpl attrs
out
private OutputStream out
jingPropertyMap
private PropertyMap jingPropertyMap
entityResolver
protected LocalCacheEntityResolver entityResolver
lastModified
private static long lastModified
preloadedSchemaUrls
private static String[] preloadedSchemaUrls
preloadedSchemas
private static Schema[] preloadedSchemas
schemaUrls
private String schemaUrls
validator
protected Validator validator
bufferingRootNamespaceSniffer
private BufferingRootNamespaceSniffer bufferingRootNamespaceSniffer
contentType
private String contentType
htmlParser
protected HtmlParser htmlParser
reader
protected XMLReader reader
documentInput
protected TypedInputSource documentInput
httpRes
protected PrudentHttpEntityResolver httpRes
loadedValidatorUrls
private Set loadedValidatorUrls
checkNormalization
private boolean checkNormalization
rootNamespaceSeen
private boolean rootNamespaceSeen
VerifierServletTransaction
VerifierServletTransaction(HttpServletRequest request,
HttpServletResponse response)
- Parameters:
request
- response
-
scrub
protected static String scrub(String s)
isCheckerUrl
private static boolean isCheckerUrl(String url)
willValidate
protected boolean willValidate()
doGet
void doGet()
throws ServletException,
IOException
- Throws:
ServletException
IOException
setup
protected void setup()
throws ServletException
- Throws:
ServletException
isHtmlUnsafePreset
private boolean isHtmlUnsafePreset()
validate
void validate()
throws SAXException
- Throws:
SAXException
emitSuccess
protected void emitSuccess()
throws SAXException
- Throws:
SAXException
emitFailure
protected void emitFailure()
throws SAXException
- Throws:
SAXException
tryToSetupValidator
protected void tryToSetupValidator()
throws SAXException,
IOException,
IncorrectSchemaException
- Throws:
SAXException
IOException
IncorrectSchemaException
loadDocAndSetupParser
protected void loadDocAndSetupParser()
throws SAXException,
IOException,
IncorrectSchemaException,
SAXNotRecognizedException,
SAXNotSupportedException
- Throws:
SAXException
IOException
IncorrectSchemaException
SAXNotRecognizedException
SAXNotSupportedException
validatorByDoctype
protected Validator validatorByDoctype(int doctype)
throws SAXException,
IOException,
IncorrectSchemaException
- Throws:
SAXException
IOException
IncorrectSchemaException
setupXmlParser
protected XMLReader setupXmlParser()
throws SAXNotRecognizedException,
SAXNotSupportedException
- Parameters:
entityResolver2
-
- Returns:
-
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
validatorByUrls
private Validator validatorByUrls(String schemaList)
throws SAXException,
IOException,
IncorrectSchemaException
- Parameters:
validator
-
- Returns:
-
- Throws:
SAXException
IOException
IncorrectSchemaException
combineValidatorByUrl
private Validator combineValidatorByUrl(Validator validator,
String url)
throws SAXException,
IOException,
IncorrectSchemaException
- Parameters:
validator
- url
-
- Returns:
-
- Throws:
SAXException
IOException
IncorrectSchemaException
validatorByUrl
private Validator validatorByUrl(String url)
throws SAXException,
IOException,
IncorrectSchemaException
- Parameters:
url
-
- Returns:
-
- Throws:
SAXException
IOException
IncorrectSchemaException
schemaByUrl
private Schema schemaByUrl(String url)
throws SAXException,
IOException,
IncorrectSchemaException
- Parameters:
url
-
- Returns:
-
- Throws:
SAXException
IOException
IncorrectSchemaException
schemaByUrl
private static Schema schemaByUrl(String url,
EntityResolver resolver,
PropertyMap pMap)
throws SAXException,
IOException,
IncorrectSchemaException
- Parameters:
url
-
- Returns:
-
- Throws:
SAXException
IOException
IncorrectSchemaException
emitTitle
void emitTitle(boolean markupAllowed)
throws SAXException
- Throws:
SAXException
emitForm
void emitForm()
throws SAXException
- Throws:
SAXException
emitFormContent
protected void emitFormContent()
throws SAXException
- Throws:
SAXException
emitSchemaField
void emitSchemaField()
throws SAXException
- Throws:
SAXException
emitDocField
void emitDocField()
throws SAXException
- Throws:
SAXException
scrubUrl
private String scrubUrl(String urlStr)
emitSchemaDuration
void emitSchemaDuration()
throws SAXException
- Throws:
SAXException
emitDocDuration
void emitDocDuration()
throws SAXException
- Throws:
SAXException
emitTotalDuration
void emitTotalDuration()
throws SAXException
- Throws:
SAXException
emitPresetOptions
void emitPresetOptions()
throws SAXException
- Throws:
SAXException
emitParserOptions
void emitParserOptions()
throws SAXException
- Throws:
SAXException
emitLaxTypeField
void emitLaxTypeField()
throws SAXException
- Throws:
SAXException
rootNamespace
void rootNamespace(String namespace,
Locator locator)
throws SAXException
- Throws:
SAXException
doctype
public void doctype(int doctype)
throws SAXException
- Specified by:
doctype
in interface DoctypeHandler
- Throws:
SAXException
schemaLabelFromDoctype
private String schemaLabelFromDoctype(int doctype)