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