|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| WebServiceTypeMapping.java | 0% | 0% | 0% | 0% |
|
||||||||||||||
| 1 | /** | |
| 2 | * JTRunner is free software; you can redistribute it and/or modify it under the | |
| 3 | * terms of the GNU General Public License as published by the Free Software | |
| 4 | * Foundation; either version 2, or (at your option) any later version. | |
| 5 | */ | |
| 6 | ||
| 7 | package jtr.config.ws; | |
| 8 | ||
| 9 | import java.io.Serializable; | |
| 10 | ||
| 11 | import javax.xml.namespace.QName; | |
| 12 | import org.apache.log4j.Logger; | |
| 13 | ||
| 14 | /** | |
| 15 | * This class is the object oriented representation of the <code>jtr.xml</code> | |
| 16 | * <code>typeMapping</code> configuration element.<br> | |
| 17 | * Such a configuration element is used to decleratively instruct the JTR-webservices | |
| 18 | * extension on how to map complex XML data types to Java objects. | |
| 19 | * @author Francesco Russo (frusso@dev.java.net) | |
| 20 | * @version 4.0 | |
| 21 | * @since 3.0 | |
| 22 | */ | |
| 23 | public class WebServiceTypeMapping implements Serializable { | |
| 24 | /** | |
| 25 | * Get the FQN of the configured Java class. | |
| 26 | * @return String | |
| 27 | */ | |
| 28 | 0 | public String getJavaClassName() { |
| 29 | 0 | return javaClassName; |
| 30 | } | |
| 31 | ||
| 32 | /** | |
| 33 | * Get a <code>Class</code> instance of the configured Java class. | |
| 34 | * @return Class | |
| 35 | * @throws ClassNotFoundException | |
| 36 | */ | |
| 37 | 0 | public Class getJavaClass() throws ClassNotFoundException { |
| 38 | 0 | logger.debug("Retrieving class "+javaClassName); |
| 39 | 0 | return Class.forName(javaClassName); |
| 40 | } | |
| 41 | ||
| 42 | /** | |
| 43 | * Set the FQN of the configured Java class | |
| 44 | * @param javaClassName | |
| 45 | * The javaClassName to set. | |
| 46 | */ | |
| 47 | 0 | public void setJavaClassName(String javaClassName) { |
| 48 | 0 | this.javaClassName = javaClassName; |
| 49 | } | |
| 50 | ||
| 51 | /** | |
| 52 | * Get the qualified name of the configured XML data type. | |
| 53 | * @return QName | |
| 54 | */ | |
| 55 | 0 | public QName getQualifiedName() { |
| 56 | 0 | if (qualifiedName!=null) |
| 57 | 0 | return qualifiedName; |
| 58 | else { | |
| 59 | 0 | qualifiedName = new QName(nameSpace,name); |
| 60 | 0 | return qualifiedName; |
| 61 | } | |
| 62 | } | |
| 63 | ||
| 64 | /** | |
| 65 | * Set the qualified name of the configured XML data type. | |
| 66 | * @param qualifiedName | |
| 67 | * The qualifiedName to set. | |
| 68 | */ | |
| 69 | 0 | public void setQualifiedName(QName qualifiedName) { |
| 70 | 0 | this.qualifiedName = qualifiedName; |
| 71 | } | |
| 72 | ||
| 73 | /** | |
| 74 | * Set the qualified name of the configured XML data type | |
| 75 | * @param nameSpace The XML namespace | |
| 76 | * @param name The XML local part of the qualified name | |
| 77 | */ | |
| 78 | 0 | public void setQualifiedName(String nameSpace, String name) { |
| 79 | 0 | this.qualifiedName = new QName(nameSpace, name); |
| 80 | } | |
| 81 | ||
| 82 | /** | |
| 83 | * Get the local part of the XML qualified name. | |
| 84 | * @return String The local part | |
| 85 | */ | |
| 86 | 0 | public String getName() { |
| 87 | 0 | return name; |
| 88 | } | |
| 89 | ||
| 90 | /** | |
| 91 | * Set the local part of the XML qualified name. | |
| 92 | * @param name The local part to set. | |
| 93 | */ | |
| 94 | 0 | public void setName(String name) { |
| 95 | 0 | this.name = name; |
| 96 | } | |
| 97 | ||
| 98 | /** | |
| 99 | * Get the name space part of the XML qualified name. | |
| 100 | * @return String | |
| 101 | */ | |
| 102 | 0 | public String getNameSpace() { |
| 103 | 0 | return nameSpace; |
| 104 | } | |
| 105 | ||
| 106 | /** | |
| 107 | * Set the name space part of the XML qualified name. | |
| 108 | * @param nameSpace The nameSpace to set. | |
| 109 | */ | |
| 110 | 0 | public void setNameSpace(String nameSpace) { |
| 111 | 0 | this.nameSpace = nameSpace; |
| 112 | } | |
| 113 | ||
| 114 | private String nameSpace; | |
| 115 | ||
| 116 | private String name; | |
| 117 | ||
| 118 | private QName qualifiedName; | |
| 119 | ||
| 120 | private String javaClassName; | |
| 121 | ||
| 122 | private final static Logger logger = Logger.getLogger(WebServiceTypeMapping.class); | |
| 123 | } |
|
||||||||||