1 /*
2 * Copyright (C) 2002 Carsten Krebs (Team-Konzept GmbH & Co.KG)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 package com.teamkonzept.dom4jb.beans.infos;
19
20 import java.beans.IntrospectionException;
21 import java.util.Map;
22
23 import com.teamkonzept.dom4jb.beans.XMLBeanInfo;
24 import com.teamkonzept.dom4jb.schema.AttributeDescriptor;
25 import com.teamkonzept.dom4jb.schema.ContentDescriptor;
26 import com.teamkonzept.dom4jb.schema.DataDescriptor;
27 import com.teamkonzept.dom4jb.schema.GroupDescriptor;
28 import com.teamkonzept.dom4jb.schema.Groupable;
29 import com.teamkonzept.dom4jb.schema.Sequence;
30
31 public class StringEntryXMLBeanInfo implements XMLBeanInfo {
32
33 private static final Sequence KEY;
34 private static final Sequence VALUE;
35
36 static {
37 try {
38 KEY =
39 new Sequence(
40 new Groupable[] {
41 new AttributeDescriptor("key", Map.Entry.class)});
42 VALUE =
43 new Sequence(
44 new Groupable[] {
45 new ContentDescriptor("value", Map.Entry.class)});
46 } catch (IntrospectionException e) {
47 throw new ExceptionInInitializerError(e);
48 }
49 }
50
51 private final String name;
52
53 /*** Creates new EntryXMLBeanInfo */
54 public StringEntryXMLBeanInfo(final String name) {
55 this.name = name;
56 }
57
58 /*** Creates new EntryXMLBeanInfo */
59 public StringEntryXMLBeanInfo() {
60 this("entry");
61 }
62
63 /***
64 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getContentDescriptors()
65 */
66 public GroupDescriptor getContentDescriptors() {
67 return VALUE;
68 }
69
70 /***
71 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getDataDescriptor()
72 */
73 public DataDescriptor getDataDescriptor() {
74 return null;
75 }
76
77 /***
78 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getAttributeDescriptors()
79 */
80 public GroupDescriptor getAttributeDescriptors() {
81 return KEY;
82 }
83
84 /***
85 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getItemName()
86 */
87 public String getItemName() {
88 return name;
89 }
90 }
This page was automatically generated by Maven