View Javadoc
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 com.teamkonzept.dom4jb.beans.XMLBeanInfo; 21 import com.teamkonzept.dom4jb.schema.DataDescriptor; 22 import com.teamkonzept.dom4jb.schema.GroupDescriptor; 23 import com.teamkonzept.dom4jb.schema.MapAdapter; 24 25 public class MapXMLBeanInfo implements XMLBeanInfo { 26 private static final MapAdapter DEFAULT_ADAPTER = new MapAdapter("entry"); 27 private static final String DEFAULT_ITEM_NAME = "map"; 28 29 private final String name; 30 private final MapAdapter adapter; 31 32 /*** Creates new MapXMLBeanInfo */ 33 public MapXMLBeanInfo(final String mapName, final MapAdapter adapter) { 34 this.name = mapName; 35 this.adapter = adapter; 36 } 37 38 /*** Creates new MapXMLBeanInfo */ 39 public MapXMLBeanInfo(final String entryName) { 40 this(DEFAULT_ITEM_NAME, new MapAdapter(entryName)); 41 } 42 43 /*** Creates new MapXMLBeanInfo */ 44 public MapXMLBeanInfo( 45 final String entryName, 46 final XMLBeanInfo entryType) { 47 this(DEFAULT_ITEM_NAME, new MapAdapter(entryName, entryType)); 48 } 49 50 /*** Creates new MapXMLBeanInfo */ 51 public MapXMLBeanInfo() { 52 this(DEFAULT_ITEM_NAME, DEFAULT_ADAPTER); 53 } 54 55 /*** 56 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getContentDescriptors() 57 */ 58 public GroupDescriptor getContentDescriptors() { 59 return adapter; 60 } 61 62 /*** 63 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getDataDescriptor() 64 */ 65 public DataDescriptor getDataDescriptor() { 66 return null; 67 } 68 69 /*** 70 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getAttributeDescriptors() 71 */ 72 public GroupDescriptor getAttributeDescriptors() { 73 return null; 74 } 75 76 /*** 77 * @see com.teamkonzept.dom4jb.beans.XMLBeanInfo#getItemName() 78 */ 79 public String getItemName() { 80 return name; 81 } 82 }

This page was automatically generated by Maven