Exemple #1
0
        protected override void visitConfigurationSpecification(ConfigurationSpecification specification)
        {
            writer.Append(KeywordEnum.FOR.ToString()).Append(' ');
            output.writeComponentSpecification(specification.ComponentSpecification);

            if (specification.EntityAspect != null)
            {
                writer.Append(' ').Append(KeywordEnum.USE.ToString()).Append(' ');
                writer.Append(specification.EntityAspect.ToString());
            }

            if (specification.GenericMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.GENERIC.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().genericMap(specification.GenericMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            if (specification.PortMap.Count != 0)
            {
                writer.NewLine();
                writer.Append(KeywordEnum.PORT.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().portMap(specification.PortMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            writer.Append(';').NewLine();
        }
        protected override void visitComponentConfiguration(ComponentConfiguration configuration)
        {
            writer.Append(KeywordEnum.FOR.ToString()).Append(' ');
            output.writeComponentSpecification(configuration.ComponentSpecification);
            writer.Indent();

            bool hasBindingIndication = false;

            if (configuration.EntityAspect != null)
            {
                hasBindingIndication = true;
                writer.NewLine().Append(KeywordEnum.USE.ToString()).Append(' ');
                writer.Append(configuration.EntityAspect.ToString());
            }

            if (configuration.GenericMap.Count != 0)
            {
                hasBindingIndication = true;
                writer.NewLine();
                writer.Append(KeywordEnum.GENERIC.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().genericMap(configuration.GenericMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            if (configuration.PortMap.Count != 0)
            {
                hasBindingIndication = true;
                writer.NewLine();
                writer.Append(KeywordEnum.PORT.ToString()).Append(KeywordEnum.MAP.ToString()).Append(" (").NewLine();
                writer.Indent().BeginAlign();
                output.getMiscellaneousElementOutput().portMap(configuration.PortMap);
                writer.EndAlign().Dedent();
                writer.Append(")");
            }

            if (hasBindingIndication)
            {
                writer.Append(";");
            }

            writer.NewLine();

            if (configuration.BlockConfiguration != null)
            {
                visit(configuration.BlockConfiguration);
            }
            writer.Dedent().Append(KeywordEnum.END.ToString()).Append(KeywordEnum.FOR.ToString());
            writer.Append(';').NewLine();
        }