1 11 package org.eclipse.pde.internal.core; 12 13 import org.xml.sax.SAXException ; 14 import org.xml.sax.ext.LexicalHandler ; 15 16 public class XMLCopyrightHandler implements LexicalHandler { 17 18 private String fCopyright = null; 19 private XMLDefaultHandler fHandler = null; 20 21 public XMLCopyrightHandler(XMLDefaultHandler handler) { 22 fHandler = handler; 23 } 24 25 public void comment(char[] ch, int start, int length) throws SAXException { 26 if (fHandler != null && fCopyright == null && 28 fHandler.fElementStack.isEmpty()) { 29 fCopyright = new String (ch, start, length); 30 } 31 } 32 33 public void endCDATA() throws SAXException { 34 } 35 36 public void endDTD() throws SAXException { 37 } 38 39 public void endEntity(String name) throws SAXException { 40 } 41 42 public void startCDATA() throws SAXException { 43 } 44 45 public void startDTD(String name, String publicId, String systemId) 46 throws SAXException { 47 } 48 49 public void startEntity(String name) throws SAXException { 50 } 51 52 public String getCopyright() { 53 return fCopyright; 54 } 55 56 } 57 | Popular Tags |