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.mongodb;
018
019import javax.inject.Inject;
020import org.eclipse.xtext.xbase.lib.Extension;
021import org.sculptor.generator.cartridge.mongodb.MongoDbProperties;
022import org.sculptor.generator.chain.ChainOverride;
023import org.sculptor.generator.template.consumer.ConsumerTmpl;
024import sculptormetamodel.Consumer;
025
026@ChainOverride
027@SuppressWarnings("all")
028public class ConsumerTmplExtension extends ConsumerTmpl {
029  @Inject
030  @Extension
031  private MongoDbProperties mongoDbProperties;
032  
033  @Override
034  public void consumerTest(final Consumer it) {
035    ConsumerTmpl headObj = getMethodsDispatchHead()[org.sculptor.generator.template.consumer.ConsumerTmplMethodIndexes.CONSUMERTEST_CONSUMER];
036    headObj._chained_consumerTest(it);
037  }
038  
039  public ConsumerTmplExtension(final ConsumerTmpl next, final ConsumerTmpl[] methodsDispatchNext) {
040    super(next);
041  }
042  
043  public void _chained_consumerTest(final Consumer it) {
044    boolean _mongoDb = this.mongoDbProperties.mongoDb();
045    if (_mongoDb) {
046    } else {
047      ConsumerTmpl _next = this.getNext();
048      _next.consumerTest(it);
049    }
050  }
051  
052  public ConsumerTmpl[] _getOverridesDispatchArray() {
053    org.sculptor.generator.template.consumer.ConsumerTmpl[] result = new org.sculptor.generator.template.consumer.ConsumerTmpl[org.sculptor.generator.template.consumer.ConsumerTmplMethodIndexes.NUM_METHODS];
054    result[org.sculptor.generator.template.consumer.ConsumerTmplMethodIndexes.CONSUMERTEST_CONSUMER] = this; 
055    return result;
056  }
057}