nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2004, 2005 IBM Corporation and others. |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 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 |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame^] | 7 | * |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | *******************************************************************************/ |
david_williams | 5677702 | 2005-04-11 06:21:55 +0000 | [diff] [blame] | 11 | package org.eclipse.wst.html.core.internal.validate; |
nitind | 958d79a | 2004-11-23 19:23:00 +0000 | [diff] [blame] | 12 | |
| 13 | abstract class AbstractErrorInfo implements ErrorInfo, ErrorState { |
| 14 | |
| 15 | |
| 16 | private int state = NONE_ERROR; |
| 17 | private Segment seg = null; |
| 18 | |
| 19 | public AbstractErrorInfo(int state, Segment seg) { |
| 20 | super(); |
| 21 | this.state = state; |
| 22 | this.seg = seg; |
| 23 | } |
| 24 | |
| 25 | abstract public String getHint(); |
| 26 | |
| 27 | abstract public short getTargetType(); |
| 28 | |
| 29 | public int getLength() { |
| 30 | return (seg == null) ? 0 : seg.getLength(); |
| 31 | } |
| 32 | |
| 33 | public int getOffset() { |
| 34 | return (seg == null) ? 0 : seg.getOffset(); |
| 35 | } |
| 36 | |
| 37 | public int getState() { |
| 38 | return this.state; |
| 39 | } |
amywu | 923ee60 | 2007-04-10 18:32:07 +0000 | [diff] [blame^] | 40 | } |