EMMA Coverage Report (generated Thu Nov 26 15:54:18 CST 2009)
[all classes][org.eclipse.pde.api.tools.internal.util]

COVERAGE SUMMARY FOR SOURCE FILE [SourceDefaultHandler.java]

nameclass, %method, %block, %line, %
SourceDefaultHandler.java100% (1/1)75%  (3/4)75%  (36/48)71%  (8.5/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SourceDefaultHandler100% (1/1)75%  (3/4)75%  (36/48)71%  (8.5/12)
error (SAXParseException): void 0%   (0/1)0%   (0/3)0%   (0/2)
startElement (String, String, String, Attributes): void 100% (1/1)75%  (27/36)79%  (5.5/7)
SourceDefaultHandler (): void 100% (1/1)100% (6/6)100% (2/2)
isSource (): boolean 100% (1/1)100% (3/3)100% (1/1)

1/*******************************************************************************
2 * Copyright (c) 2007, 2008 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 
12package org.eclipse.pde.api.tools.internal.util;
13 
14import org.xml.sax.Attributes;
15import org.xml.sax.SAXException;
16import org.xml.sax.SAXParseException;
17import org.xml.sax.helpers.DefaultHandler;
18 
19public class SourceDefaultHandler extends DefaultHandler {
20        private static final String ORG_ECLIPSE_PDE_CORE_SOURCE_EXTENSION_POINT_NAME = "org.eclipse.pde.core.source"; //$NON-NLS-1$
21        private static final String EXTENSION_NAME = "extension"; //$NON-NLS-1$
22        private static final String ECLIPSE_POINT_ATTRIBUTE_NAME = "point"; //$NON-NLS-1$
23        boolean isSource = false;
24        public void error(SAXParseException e) throws SAXException {
25                e.printStackTrace();
26        }
27        public void startElement(String uri, String localName, String name, Attributes attributes)
28                        throws SAXException {
29                if (this.isSource) return;
30                this.isSource = EXTENSION_NAME.equals(name)
31                                && attributes.getLength() == 1
32                                && (ECLIPSE_POINT_ATTRIBUTE_NAME.equals(attributes.getQName(0))
33                                                || ECLIPSE_POINT_ATTRIBUTE_NAME.equals(attributes.getLocalName(0)))
34                                && ORG_ECLIPSE_PDE_CORE_SOURCE_EXTENSION_POINT_NAME.equals(attributes.getValue(0));
35        }
36        public boolean isSource() {
37                return this.isSource;
38        }
39}

[all classes][org.eclipse.pde.api.tools.internal.util]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov