KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > builders > FragmentErrorReporter


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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.pde.internal.core.builders;
12
13 import org.eclipse.core.resources.IFile;
14 import org.w3c.dom.Attr JavaDoc;
15 import org.w3c.dom.Element JavaDoc;
16
17
18 public class FragmentErrorReporter extends PluginBaseErrorReporter {
19
20     public FragmentErrorReporter(IFile file) {
21         super(file);
22     }
23     
24      /* (non-Javadoc)
25      * @see org.eclipse.pde.internal.builders.PluginBaseErrorReporter#validateTopLevelAttributes(org.w3c.dom.Element)
26      */

27     protected void validateTopLevelAttributes(Element JavaDoc element) {
28         super.validateTopLevelAttributes(element);
29         
30         if (assertAttributeDefined(element, "plugin-id", CompilerFlags.ERROR)) //$NON-NLS-1$
31
validatePluginIDRef(element, element.getAttributeNode("plugin-id")); //$NON-NLS-1$
32

33         if (assertAttributeDefined(element, "plugin-version", CompilerFlags.ERROR)) //$NON-NLS-1$
34
validateVersionAttribute(element, element.getAttributeNode("plugin-version")); //$NON-NLS-1$
35

36         Attr JavaDoc attr = element.getAttributeNode("match"); //$NON-NLS-1$
37
if (attr != null)
38             validateMatch(element, attr);
39     }
40     
41     protected String JavaDoc getRootElementName() {
42         return "fragment"; //$NON-NLS-1$
43
}
44     
45 }
46
Popular Tags