| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Matcher |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Matcher.java May 2007 | |
| 3 | * | |
| 4 | * Copyright (C) 2007, Niall Gallagher <niallg@users.sf.net> | |
| 5 | * | |
| 6 | * This library is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU Lesser General Public | |
| 8 | * License as published by the Free Software Foundation. | |
| 9 | * | |
| 10 | * This library is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General | |
| 16 | * Public License along with this library; if not, write to the | |
| 17 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, | |
| 18 | * Boston, MA 02111-1307 USA | |
| 19 | */ | |
| 20 | ||
| 21 | package org.simpleframework.xml.transform; | |
| 22 | ||
| 23 | /** | |
| 24 | * The <code>Matcher</code> is used to match a type with a transform | |
| 25 | * such that a string value can be read or written as that type. If | |
| 26 | * there is no match this will typically return a null to indicate | |
| 27 | * that another matcher should be delegated to. If there is an error | |
| 28 | * in performing the match an exception is thrown. | |
| 29 | * | |
| 30 | * @author Niall Gallagher | |
| 31 | * | |
| 32 | * @see org.simpleframework.xml.transform.Transformer | |
| 33 | */ | |
| 34 | interface Matcher { | |
| 35 | ||
| 36 | /** | |
| 37 | * This is used to match a <code>Transform</code> using the type | |
| 38 | * specified. If no transform can be acquired then this returns | |
| 39 | * a null value indicating that no transform could be found. | |
| 40 | * | |
| 41 | * @param type this is the type to acquire the transform for | |
| 42 | * | |
| 43 | * @return returns a transform for processing the type given | |
| 44 | * | |
| 45 | * @throws Exception thrown if a transform could not be found | |
| 46 | */ | |
| 47 | public Transform match(Class type) throws Exception; | |
| 48 | } |