1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 package com.sun.star.report.pentaho.parser.xlink; 24 25 import com.sun.star.report.pentaho.OfficeNamespaces; 26 27 import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlReadHandler; 28 29 import org.xml.sax.Attributes; 30 import org.xml.sax.SAXException; 31 32 /** 33 * An image reference. 34 * 35 * @author Thomas Morgner 36 */ 37 public class XLinkReadHandler extends AbstractXmlReadHandler 38 { 39 40 private String uri; 41 private String type; 42 private String show; 43 private String actuate; 44 XLinkReadHandler()45 public XLinkReadHandler() 46 { 47 } 48 49 /** 50 * Starts parsing. 51 * 52 * @param attrs the attributes. 53 * @throws org.xml.sax.SAXException if there is a parsing error. 54 */ startParsing(final Attributes attrs)55 protected void startParsing(final Attributes attrs) throws SAXException 56 { 57 uri = attrs.getValue(OfficeNamespaces.XLINK_NS, "uri"); 58 type = attrs.getValue(OfficeNamespaces.XLINK_NS, "type"); 59 show = attrs.getValue(OfficeNamespaces.XLINK_NS, "show"); 60 actuate = attrs.getValue(OfficeNamespaces.XLINK_NS, "actuate"); 61 } 62 63 /** 64 * Returns the object for this element or null, if this element does not 65 * create an object. 66 * 67 * @return the object. 68 */ getObject()69 public Object getObject() throws SAXException 70 { 71 return uri; 72 } 73 getUri()74 public String getUri() 75 { 76 return uri; 77 } 78 getType()79 public String getType() 80 { 81 return type; 82 } 83 getShow()84 public String getShow() 85 { 86 return show; 87 } 88 getActuate()89 public String getActuate() 90 { 91 return actuate; 92 } 93 } 94