| 1 |
/* |
| 2 |
* Copyright 2001-2004 The Apache Software Foundation. |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
package test.encoding; |
| 17 |
|
| 18 |
import org.apache.axis.description.AttributeDesc; |
| 19 |
import org.apache.axis.description.ElementDesc; |
| 20 |
import org.apache.axis.description.FieldDesc; |
| 21 |
import org.apache.axis.description.TypeDesc; |
| 22 |
|
| 23 |
import javax.xml.namespace.QName; |
| 24 |
|
| 25 |
/** |
| 26 |
* @author Glen Daniels ([email protected]) |
| 27 |
*/ |
| 28 |
public class ParentBean { |
| 29 |
private float parentFloat; // attribute |
| 30 |
private String parentStr; // element |
| 31 |
|
| 32 |
public float getParentFloat() { |
| 33 |
return parentFloat; |
| 34 |
} |
| 35 |
|
| 36 |
public void setParentFloat(float parentFloat) { |
| 37 |
this.parentFloat = parentFloat; |
| 38 |
} |
| 39 |
|
| 40 |
public String getParentStr() { |
| 41 |
return parentStr; |
| 42 |
} |
| 43 |
|
| 44 |
public void setParentStr(String parentStr) { |
| 45 |
this.parentStr = parentStr; |
| 46 |
} |
| 47 |
|
| 48 |
// Type metadata |
| 49 |
private static TypeDesc typeDesc; |
| 50 |
|
| 51 |
static { |
| 52 |
typeDesc = new TypeDesc(ParentBean.class); |
| 53 |
FieldDesc field; |
| 54 |
|
| 55 |
// An attribute with a specified QName |
| 56 |
field = new AttributeDesc(); |
| 57 |
field.setFieldName("parentFloat"); |
| 58 |
field.setXmlName(new QName("", "parentAttr")); |
| 59 |
typeDesc.addFieldDesc(field); |
| 60 |
|
| 61 |
// An element with a specified QName |
| 62 |
field = new ElementDesc(); |
| 63 |
field.setFieldName("parentStr"); |
| 64 |
field.setXmlName(new QName("", "parentElement")); |
| 65 |
((ElementDesc)field).setNillable(true); |
| 66 |
typeDesc.addFieldDesc(field); |
| 67 |
} |
| 68 |
|
| 69 |
public static TypeDesc getTypeDesc() |
| 70 |
{ |
| 71 |
return typeDesc; |
| 72 |
} |
| 73 |
} |