001/** 002 * Copyright 2014 The Sculptor Project Team, including the original 003 * author or authors. 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.sculptor.generator.cartridge.builder; 018 019import java.util.List; 020import org.sculptor.generator.cartridge.builder.BuilderHelper; 021import sculptormetamodel.Attribute; 022import sculptormetamodel.DomainObject; 023import sculptormetamodel.NamedElement; 024import sculptormetamodel.Reference; 025 026/** 027 * Method dispatch class for BuilderHelper, used for dispatching to overrideable methods 028 */ 029@SuppressWarnings("all") 030public class BuilderHelperMethodDispatch extends BuilderHelper { 031 public BuilderHelperMethodDispatch(final BuilderHelper[] methodsDispatchTable) { 032 super(null); 033 this.methodsDispatchTable = methodsDispatchTable; 034 } 035 036 public BuilderHelperMethodDispatch(final BuilderHelper next, final BuilderHelper[] methodsDispatchTable) { 037 super(next); 038 this.methodsDispatchTable = methodsDispatchTable; 039 } 040 041 private final BuilderHelper[] methodsDispatchTable; 042 043 public final BuilderHelper[] getMethodsDispatchTable() { 044 return(methodsDispatchTable); 045 } 046 047 public List<Attribute> getBuilderAttributes(final DomainObject domainObject) { 048 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERATTRIBUTES_DOMAINOBJECT]; 049 return nextObj._chained_getBuilderAttributes(domainObject); 050 } 051 052 public List<Reference> getBuilderReferences(final DomainObject domainObject) { 053 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERREFERENCES_DOMAINOBJECT]; 054 return nextObj._chained_getBuilderReferences(domainObject); 055 } 056 057 public List<NamedElement> getBuilderConstructorParameters(final DomainObject domainObject) { 058 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERCONSTRUCTORPARAMETERS_DOMAINOBJECT]; 059 return nextObj._chained_getBuilderConstructorParameters(domainObject); 060 } 061 062 public List<NamedElement> getBuilderProperties(final DomainObject domainObject) { 063 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERPROPERTIES_DOMAINOBJECT]; 064 return nextObj._chained_getBuilderProperties(domainObject); 065 } 066 067 public String getBuilderClassName(final DomainObject domainObject) { 068 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERCLASSNAME_DOMAINOBJECT]; 069 return nextObj._chained_getBuilderClassName(domainObject); 070 } 071 072 public String getBuilderFqn(final DomainObject domainObject) { 073 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes.GETBUILDERFQN_DOMAINOBJECT]; 074 return nextObj._chained_getBuilderFqn(domainObject); 075 } 076 077 public boolean _needsBuilder(final DomainObject domainObject) { 078 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes._NEEDSBUILDER_DOMAINOBJECT]; 079 return nextObj._chained__needsBuilder(domainObject); 080 } 081 082 public boolean _needsBuilder(final sculptormetamodel.Enum domainObject) { 083 BuilderHelper nextObj = methodsDispatchTable[org.sculptor.generator.cartridge.builder.BuilderHelperMethodIndexes._NEEDSBUILDER_ENUM]; 084 return nextObj._chained__needsBuilder(domainObject); 085 } 086}