Ejemplo n.º 1
0
        /// <summary>
        /// Adds a needed Extra.
        /// </summary>
        public void AddExtra(INeedsExtra extra)
        {
            if (extra == null)
            {
                return;
            }

            if (!extrasNeeded.Contains(extra))
            {
                this.extrasNeeded.Add(extra);
            }
        }
Ejemplo n.º 2
0
        private TransformationNodeClass GenerateClassAsTransformation()
        {
            string javaFreandlyName = ElementName.RemoveAll(" ", "_");

            string description = Description;
            string mainClass   = PackageName + "." + javaFreandlyName;
            string creator     = Environment.UserName;

            string[]        neededOtherClasses = new string[0];
            INeedsExtra[]   neededExtras       = new INeedsExtra[0];
            ConfigElement[] config             = new ConfigElement[0];
            ProxyProperty[] proxyProperties    = new ProxyProperty[0];
            string          methodName         = javaFreandlyName;
            bool            isStatic           = true;

            return(new TransformationNodeClass(javaFreandlyName, ElementName, description, creator, OutputType, InputTypes.ToArray(),
                                               mainClass, neededOtherClasses, neededExtras, config, proxyProperties, true, Path.Combine(WorkSpace.DIR, WorkSpace.CREATED_DIR, javaFreandlyName),
                                               methodName, isStatic));
        }
Ejemplo n.º 3
0
        private DataSourceNodeClass GenerateClassAsDataSource()
        {
            string javaFreandlyName = ElementName.RemoveAll(" ", "_");

            string description = Description;
            string mainClass   = PackageName + "." + javaFreandlyName;
            string creator     = Environment.UserName;

            string[]        neededOtherClasses = new string[0];
            INeedsExtra[]   neededExtras       = new INeedsExtra[0];
            ConfigElement[] config             = new ConfigElement[0];
            ProxyProperty[] proxyProperties    = new ProxyProperty[0];
            string          dataMethod         = "getData";
            string          startMethod        = "start";
            string          stopMethod         = "stop";

            return(new DataSourceNodeClass(javaFreandlyName, ElementName, description, creator, OutputType,
                                           mainClass, neededOtherClasses, neededExtras, config, proxyProperties, true, Path.Combine(WorkSpace.DIR, WorkSpace.CREATED_DIR, javaFreandlyName),
                                           dataMethod, startMethod, stopMethod));
        }
Ejemplo n.º 4
0
        public static JObject serialize(INeedsExtra extra)
        {
            if (extra is NeedsBroadcast)
            {
                return(serializeBroadcast(extra as NeedsBroadcast));
            }
            if (extra is NeedsService)
            {
                return(serializeService(extra as NeedsService));
            }
            if (extra is NeedsLibrary)
            {
                return(serializeLibrary(extra as NeedsLibrary));
            }
            if (extra is NeedsPermission)
            {
                return(serializePermission(extra as NeedsPermission));
            }

            return(null);
        }