nu.validator.servlet
Class VerifierServletTransaction
java.lang.Object
nu.validator.servlet.VerifierServletTransaction
- All Implemented Interfaces:
- DocumentModeHandler
- Direct Known Subclasses:
- Html5ConformanceCheckerTransaction
class VerifierServletTransaction
- extends Object
- implements DocumentModeHandler
- 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
JS_IDENTIFIER
private static final Pattern JS_IDENTIFIER
JS_RESERVED_WORDS
private static final String[] JS_RESERVED_WORDS
HTML5_SCHEMA
protected static final int HTML5_SCHEMA
- See Also:
- Constant Field Values
XHTML1STRICT_SCHEMA
protected static final int XHTML1STRICT_SCHEMA
- See Also:
- Constant Field Values
XHTML1TRANSITIONAL_SCHEMA
protected static final int XHTML1TRANSITIONAL_SCHEMA
- 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
FOR
private static final char[] FOR
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 final HttpServletRequest request
response
private final HttpServletResponse response
iriFactory
private com.hp.hpl.jena.iri.IRIFactory iriFactory
document
protected String document
parser
private ParserMode parser
laxType
private boolean laxType
contentHandler
protected ContentHandler contentHandler
emitter
protected XhtmlSaxEmitter emitter
errorHandler
protected MessageEmitterAdapter 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
xmlParser
protected SAXDriver xmlParser
reader
protected XMLReader reader
documentInput
protected TypedInputSource documentInput
httpRes
protected PrudentHttpEntityResolver httpRes
contentTypeParser
protected ContentTypeParser contentTypeParser
loadedValidatorUrls
private Set<String> loadedValidatorUrls
checkNormalization
private boolean checkNormalization
rootNamespaceSeen
private boolean rootNamespaceSeen
outputFormat
private VerifierServletTransaction.OutputFormat outputFormat
postContentType
private String postContentType
methodIsGet
private boolean methodIsGet
sourceCode
private SourceCode sourceCode
showSource
private boolean showSource
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()
service
void service()
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
successMessage
protected String successMessage()
throws SAXException
- Returns:
-
- Throws:
SAXException
failureMessage
protected String failureMessage()
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
newHtmlParser
protected void newHtmlParser()
validatorByDoctype
protected Validator validatorByDoctype(int schemaId)
throws SAXException,
IOException,
IncorrectSchemaException
- Throws:
SAXException
IOException
IncorrectSchemaException
setupXmlParser
protected void setupXmlParser()
throws SAXNotRecognizedException,
SAXNotSupportedException
- Parameters:
entityResolver2
-
- 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
emitShowSourceField
void emitShowSourceField()
throws SAXException
- Throws:
SAXException
rootNamespace
void rootNamespace(String namespace,
Locator locator)
throws SAXException
- Throws:
SAXException
documentMode
public void documentMode(DocumentMode mode,
String publicIdentifier,
String systemIdentifier,
boolean html4SpecificAdditionalErrorChecks)
throws SAXException
- Specified by:
documentMode
in interface DocumentModeHandler
- Throws:
SAXException
setAcceptAllKnownXmlTypes
protected void setAcceptAllKnownXmlTypes(boolean acceptAllKnownXmlTypes)
- Parameters:
acceptAllKnownXmlTypes
- - See Also:
ContentTypeParser.setAcceptAllKnownXmlTypes(boolean)
setAllowGenericXml
protected void setAllowGenericXml(boolean allowGenericXml)
- Parameters:
allowGenericXml
- - See Also:
ContentTypeParser.setAllowGenericXml(boolean)
setAllowHtml
protected void setAllowHtml(boolean allowHtml)
- Parameters:
allowHtml
- - See Also:
ContentTypeParser.setAllowHtml(boolean)
setAllowRnc
protected void setAllowRnc(boolean allowRnc)
- Parameters:
allowRnc
- - See Also:
ContentTypeParser.setAllowRnc(boolean)
setAllowXhtml
protected void setAllowXhtml(boolean allowXhtml)
- Parameters:
allowXhtml
- - See Also:
ContentTypeParser.setAllowXhtml(boolean)
loadDocumentInput
protected void loadDocumentInput()
throws SAXException,
IOException
- Throws:
SAXException
IOException