nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2004 IBM Corporation and others. |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | *******************************************************************************/ |
| 11 | package org.eclipse.wst.html.core.validate; |
| 12 | |
| 13 | |
| 14 | import org.eclipse.wst.xml.core.internal.validate.ValidationComponent; |
| 15 | |
| 16 | class HTMLSimpleDocumentValidator extends CompositeValidator { |
| 17 | |
| 18 | /** |
| 19 | * HTMLSimpleDocumentValidator constructor comment. |
| 20 | */ |
| 21 | public HTMLSimpleDocumentValidator() { |
| 22 | super(); |
| 23 | |
| 24 | ValidationComponent[] validators = new ValidationComponent[2]; |
| 25 | |
| 26 | validators[0] = new HTMLDocumentContentValidator(); |
| 27 | validators[1] = new SyntaxValidator(); |
| 28 | |
| 29 | register(validators); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Allowing the INodeAdapter to compare itself against the type |
| 34 | * allows it to return true in more than one case. |
| 35 | */ |
| 36 | public boolean isAdapterForType(Object type) { |
| 37 | return ((type == HTMLSimpleDocumentValidator.class) || super.isAdapterForType(type)); |
| 38 | } |
| 39 | } |