001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.orm.hibernate.tuplizer.proxy;
020
021import java.util.Iterator;
022import java.util.Set;
023
024import lucee.runtime.Component;
025import lucee.runtime.ComponentPro;
026import lucee.runtime.PageContext;
027import lucee.runtime.component.Member;
028import lucee.runtime.component.Property;
029import lucee.runtime.dump.DumpData;
030import lucee.runtime.dump.DumpProperties;
031import lucee.runtime.exp.PageException;
032import lucee.runtime.type.Struct;
033
034/*
035 * this implementation "simulates" all ComponentPro methods from core 
036 */
037
038public abstract class ComponentProProxy extends ComponentProxy implements ComponentPro {
039
040        private static final long serialVersionUID = -7646935560408716588L;
041        
042        public abstract ComponentPro getComponentPro();
043        
044
045        public Property[] getProperties(boolean onlyPeristent, boolean includeBaseProperties, boolean overrideProperties, boolean inheritedMappedSuperClassOnly) {
046                return getComponentPro().getProperties(onlyPeristent, includeBaseProperties, overrideProperties, inheritedMappedSuperClassOnly);
047        }
048
049        public static Property[] getProperties(Component c,boolean onlyPeristent, boolean includeBaseProperties, boolean overrideProperties, boolean inheritedMappedSuperClassOnly) {
050                return ((ComponentPro)c).getProperties(onlyPeristent, includeBaseProperties, overrideProperties, inheritedMappedSuperClassOnly);
051        }
052        
053        public boolean isPersistent() {
054                return getComponentPro().isPersistent();
055        }
056
057        public static boolean isPersistent(Component c) {
058                return ((ComponentPro)c).isPersistent();
059        }
060
061        public boolean isAccessors() {
062                return getComponentPro().isAccessors();
063        }
064
065        public Object getMetaStructItem(Key name) {
066                return getComponentPro().getMetaStructItem(name);
067        }
068        public static Object getMetaStructItem(Component c,Key name) {
069                return ((ComponentPro)c).getMetaStructItem(name);
070        }
071
072        public Set<Key> keySet(int access) {
073                return getComponentPro().keySet(access);
074        }
075
076        public Object call(PageContext pc, int access, Key name, Object[] args) throws PageException {
077                return getComponentPro().call(pc, access, name, args);
078        }
079
080        public Object callWithNamedValues(PageContext pc, int access, Key name, Struct args) throws PageException {
081                return getComponentPro().callWithNamedValues(pc, access, name, args);
082        }
083
084        public int size(int access) {
085                return getComponentPro().size(access);
086        }
087
088        public Key[] keys(int access) {
089                return getComponentPro().keys(access);
090        }
091
092        public Iterator<Entry<Key, Object>> entryIterator(int access) {
093                return getComponentPro().entryIterator(access);
094        }
095
096        public Iterator<Object> valueIterator(int access) {
097                return getComponentPro().valueIterator(access);
098        }
099
100        public Object get(int access, Key key) throws PageException {
101                return getComponentPro().get(access, key);
102        }
103
104        public Object get(int access, Key key, Object defaultValue) {
105                return getComponentPro().get(access, key, defaultValue);
106        }
107
108        public Iterator<Key> keyIterator(int access) {
109                return getComponentPro().keyIterator(access);
110        }
111        
112        public Iterator<String> keysAsStringIterator(int access) {
113                return getComponentPro().keysAsStringIterator(access);
114        }
115
116        public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp, int access) {
117                return getComponentPro().toDumpData(pageContext, maxlevel, dp, access);
118        }
119
120        public boolean contains(int access, Key name) {
121                return getComponentPro().contains(access, name);
122        }
123
124        public Member getMember(int access, Key key, boolean dataMember, boolean superAccess) {
125                return getComponentPro().getMember(access, key, dataMember, superAccess);
126        }
127        
128        public void setEntity(boolean entity) {
129                getComponentPro().setEntity(entity);
130        }
131        
132        public static void setEntity(Component c,boolean entity) {
133                ((ComponentPro)c).setEntity(entity);
134        }
135
136        public boolean isEntity() {
137                return getComponentPro().isEntity();
138        }
139
140        public Component getBaseComponent() {
141                return getComponentPro().getBaseComponent();
142        }
143}