All Downloads are FREE. Search and download functionalities are using the official Maven repository.

juliac.generated.SCAPrimitivePropertyControllerImpl Maven / Gradle / Ivy

There is a newer version: 2.7
Show newest version
package juliac.generated;

import org.objectweb.fractal.julia.Controller;
import org.objectweb.fractal.julia.loader.Generated;
import java.util.HashMap;
import org.ow2.frascati.tinfi.control.property.IllegalPromoterException;
import org.objectweb.fractal.julia.InitializationContext;
import org.objectweb.fractal.api.factory.InstantiationException;
import java.util.Map;
import org.objectweb.fractal.api.control.NameController;
import org.ow2.frascati.tinfi.control.content.SCAContentController;
import org.ow2.frascati.tinfi.control.property.SCAPropertyController;
import java.util.Set;

/** 
 * @see org.objectweb.fractal.julia.BasicControllerMixin
 * @see org.ow2.frascati.tinfi.control.content.UseSCAContentControllerMixin
 * @see org.objectweb.fractal.julia.control.name.UseNameControllerMixin
 * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin
 */
public class SCAPrimitivePropertyControllerImpl implements Controller , Generated , SCAPropertyController {
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#values
     */
    private Map  values = new HashMap ();
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#types
     */
    private Map>  types = new HashMap> ();
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#promoters
     */
    private Map  promoters = new HashMap ();
    
    /** 
     * @see org.ow2.frascati.tinfi.control.content.UseSCAContentControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$0(final InitializationContext ic) throws InstantiationException {
        weaveableSCACC = ((SCAContentController)(ic.interfaces.get(SCAContentController.NAME)));
        initFcController$1(ic);
    }
    
    /** 
     * @see org.objectweb.fractal.julia.BasicControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$1(final InitializationContext ic) throws InstantiationException {
    }
    
    /** 
     * @see org.objectweb.fractal.julia.control.name.UseNameControllerMixin#weaveableOptNC
     */
    public NameController weaveableOptNC;
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#setType(java.lang.String,java.lang.Class)
     */
    public void setType(String name, Class  type) {
        SCAPropertyController promoter = promoters.get(name);
        if (promoter == null) {
            types.put(name ,type);
        } else {
            promoter.setType(name ,type);
        }
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.content.UseSCAContentControllerMixin#weaveableSCACC
     */
    @SuppressWarnings(value = "unused")
    private SCAContentController weaveableSCACC;
    
    /** 
     * @see org.objectweb.fractal.julia.control.name.UseNameControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    public void initFcController(final InitializationContext ic) throws InstantiationException {
        weaveableOptNC = ((NameController)(ic.getOptionalInterface("name-controller")));
        initFcController$0(ic);
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#setValue(java.lang.String,java.lang.Object)
     */
    public void setValue(String name, Object value) {
        SCAPropertyController promoter = promoters.get(name);
        if (promoter == null) {
            values.put(name ,value);
            weaveableSCACC.setPropertyValue(name ,value);
        } else {
            promoter.setValue(name ,value);
        }
    }
    
    private void initFcController$2(InitializationContext ic) throws InstantiationException {
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getType(java.lang.String)
     */
    public Class  getType(String name) {
        SCAPropertyController promoter = promoters.get(name);
        if (promoter == null) {
            return types.get(name);
        } else {
            return promoter.getType(name);
        }
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getValue(java.lang.String)
     */
    public Object getValue(String name) {
        SCAPropertyController promoter = promoters.get(name);
        if (promoter == null) {
            return values.get(name);
        } else {
            return promoter.getValue(name);
        }
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#containsPropertyName(java.lang.String)
     */
    public boolean containsPropertyName(String name) {
        SCAPropertyController promoter = promoters.get(name);
        if (promoter == null) {
            return values.containsKey(name);
        } else {
            return promoter.containsPropertyName(name);
        }
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getPropertyNames()
     */
    public String[] getPropertyNames() {
        Set  keys = values.keySet();
        String[] names = keys.toArray(new String[keys.size()]);
        return names;
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#containsDeclaredPropertyName(java.lang.String)
     */
    public boolean containsDeclaredPropertyName(String name) {
        boolean b = weaveableSCACC.containsPropertyName(name);
        return b;
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getDeclaredPropertyNames()
     */
    public String[] getDeclaredPropertyNames() {
        String[] names = weaveableSCACC.getPropertyNames();
        return names;
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getDeclaredPropertyType(java.lang.String)
     */
    public Class  getDeclaredPropertyType(String name) {
        Class  type = weaveableSCACC.getPropertyType(name);
        return type;
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#setPromoter(java.lang.String,org.ow2.frascati.tinfi.control.property.SCAPropertyController)
     */
    public void setPromoter(String name, SCAPropertyController promoter) throws IllegalPromoterException {
        promoters.put(name ,promoter);
        if (promoter != null) {
            SCAPropertyController peer = promoter.getPromoter(name);
            if (peer == (this)) {
                String compname = weaveableOptNC.getFcName();
                throw new IllegalPromoterException(compname);
            } 
        } 
    }
    
    /** 
     * @see org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin#getPromoter(java.lang.String)
     */
    public SCAPropertyController getPromoter(String name) {
        return promoters.get(name);
    }
    
    public String getFcGeneratorParameters() {
        return "(org.objectweb.fractal.juliac.spoon.MixinClassGenerator juliac.generated.SCAPrimitivePropertyControllerImpl org.objectweb.fractal.julia.BasicControllerMixin org.ow2.frascati.tinfi.control.content.UseSCAContentControllerMixin org.objectweb.fractal.julia.control.name.UseNameControllerMixin org.ow2.frascati.tinfi.control.property.SCAPropertyControllerMixin)";
    }
    
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy