001/**
002 * Copyright 2013 John Ericksen
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *    http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.androidtransfuse.experiment;
017
018import org.androidtransfuse.adapter.ASTType;
019import org.androidtransfuse.adapter.MethodSignature;
020import org.androidtransfuse.adapter.PackageClass;
021import org.androidtransfuse.analysis.AnalysisContext;
022import org.androidtransfuse.model.InjectionNode;
023
024import java.util.ArrayList;
025import java.util.Collection;
026import java.util.List;
027
028/**
029 * @author John Ericksen
030 */
031public class ComponentDescriptor {
032
033    private final ASTType target;
034    private final ASTType componentType;
035    private final PackageClass packageClass;
036    private final List<Generation> generators = new ArrayList<Generation>();
037    private final List<MethodSignature> generateFirst = new ArrayList<MethodSignature>();
038    private final AnalysisContext analysisContext;
039    private InjectionNode rootInjectionNode;
040
041    public ComponentDescriptor(ASTType target, ASTType componentType, PackageClass packageClass) {
042        this(target, componentType, packageClass, null);
043    }
044
045    public ComponentDescriptor(ASTType target, ASTType componentType, PackageClass packageClass, AnalysisContext analysisContext) {
046        this.target = target;
047        this.packageClass = packageClass;
048        this.componentType = componentType;
049        this.analysisContext = analysisContext;
050    }
051
052    public Collection<Generation> getGenerators() {
053        return generators;
054    }
055
056    public PackageClass getPackageClass() {
057        return packageClass;
058    }
059
060    public ASTType getTarget() {
061        return target;
062    }
063
064    public AnalysisContext getAnalysisContext() {
065        return analysisContext;
066    }
067
068    public ASTType getType() {
069        return componentType;
070    }
071
072    public List<MethodSignature> getGenerateFirst() {
073        return generateFirst;
074    }
075
076    public InjectionNode getRootInjectionNode() {
077        return rootInjectionNode;
078    }
079
080    public void setRootInjectionNode(InjectionNode rootInjectionNode) {
081        this.rootInjectionNode = rootInjectionNode;
082    }
083}