001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (C) Alkacon Software (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.acacia.client.export; 029 030import org.opencms.acacia.shared.CmsType; 031 032import org.timepedia.exporter.client.Export; 033import org.timepedia.exporter.client.ExportPackage; 034import org.timepedia.exporter.client.Exportable; 035 036/** 037 * Exportable wrapper for entity types.<p> 038 */ 039@Export 040@ExportPackage(value = "acacia") 041public class CmsTypeWrapper implements Exportable { 042 043 /** The wrapped type object. */ 044 private CmsType m_type; 045 046 /** 047 * Default constructor. 048 */ 049 public CmsTypeWrapper() { 050 051 } 052 053 /** 054 * Wrapper constructor.<p> 055 * 056 * @param type the type object to wrap 057 */ 058 public CmsTypeWrapper(CmsType type) { 059 060 m_type = type; 061 } 062 063 /** 064 * Wrapper method.<p> 065 * 066 * @param attributeName parameter for the wrapped method 067 * 068 * @return the result of the wrapped method 069 */ 070 public int getAttributeMaxOccurrence(String attributeName) { 071 072 return m_type.getAttributeMaxOccurrence(attributeName); 073 } 074 075 /** 076 * Wrapper method.<p> 077 * 078 * @param attributeName parameter for the wrapped method 079 * 080 * @return the result of the wrapped method 081 */ 082 public int getAttributeMinOccurrence(String attributeName) { 083 084 return m_type.getAttributeMinOccurrence(attributeName); 085 } 086 087 /** 088 * Wrapper method.<p> 089 * 090 * @return the result of the wrapped method 091 */ 092 public String[] getAttributeNames() { 093 094 return CmsWrapperUtils.arrayFromStringList(m_type.getAttributeNames()); 095 } 096 097 /** 098 * Wrapper method.<p> 099 * 100 * @param attributeName parameter for the wrapped method 101 * 102 * @return the result of the wrapped method 103 */ 104 public CmsTypeWrapper getAttributeType(String attributeName) { 105 106 return new CmsTypeWrapper(m_type.getAttributeType(attributeName)); 107 } 108 109 /** 110 * Wrapper method.<p> 111 * 112 * @param attributeName parameter for the wrapped method 113 * 114 * @return the result of the wrapped method 115 */ 116 public String getAttributeTypeName(String attributeName) { 117 118 return m_type.getAttributeTypeName(attributeName); 119 } 120 121 /** 122 * Wrapper method.<p> 123 * 124 * @return the result of the wrapped method 125 */ 126 public int getChoiceMaxOccurrence() { 127 128 return m_type.getChoiceMaxOccurrence(); 129 } 130 131 /** 132 * Wrapper method.<p> 133 * 134 * @return the result of the wrapped method 135 */ 136 public String getId() { 137 138 return m_type.getId(); 139 } 140 141 /** 142 * Wrapper method.<p> 143 * 144 * @return the result of the wrapped method 145 */ 146 public boolean isChoice() { 147 148 return m_type.isChoice(); 149 } 150 151 /** 152 * Wrapper method.<p> 153 * 154 * @return the result of the wrapped method 155 */ 156 public boolean isSimpleType() { 157 158 return m_type.isSimpleType(); 159 } 160}