Package com.alibaba.antx.config.descriptor

Examples of com.alibaba.antx.config.descriptor.ConfigProperty


                maxLengthValue = length;
            }
        }

        for (int i = 0; i < props.length; i++) {
            ConfigProperty prop = props[i];

            StringBuffer buffer = new StringBuffer();

            // �����Ŀ�������ļ��в����ڣ�����ʾ?
            boolean absent = !getKeys().contains(prop.getName());

            // ����DZ�����, ����ʾ*��
            boolean required = prop.isRequired();

            // �����Ŀ������shared properties�У�����ʾS
            boolean shared = propSet.isShared(prop.getName());

            if (shared) {
                if (absent) {
                    buffer.append("s");
                } else {
                    buffer.append("S");
                }
            } else {
                if (absent) {
                    buffer.append("?");
                } else {
                    buffer.append(" ");
                }
            }

            if (required) {
                buffer.append("* ");
            } else {
                buffer.append("  ");
            }

            // ��ʾproperty���
            buffer.append(i + 1).append(" - ");

            // ��ʾproperty����
            buffer.append(prop.getName());

            // ��ʾpropertyֵ
            String value = getPropertyValue(prop, true);

            if (value != null) {
                for (int j = 0; j < (maxLength - prop.getName().length()); j++) {
                    buffer.append(' ');
                }

                buffer.append("  = ").append(value);
            }

            // ��ʾproperty����
            if (prop.getDescription() != null) {
                int length = (value == null) ? prop.getName().length() : (Math.max(prop.getName().length(), maxLength)
                        + "  = ".length() + value.length());

                for (int j = 0; j < (maxLengthValue - length); j++) {
                    buffer.append(' ');
                }

                buffer.append("   # ").append(prop.getDescription());
            }

            // ���ֵ�DZ��ʽ����ͬʱ��ʾ���ʽ�ļ���ֵ
            String evaluatedValue = evaluatePropertyValue(prop, true);

View Full Code Here


            }
        }
    }

    private void processInput(int index) {
        ConfigProperty prop = props[index];
        StringBuffer buffer = new StringBuffer(" ������");

        // ��ʾproperty����
        if (prop.getDescription() != null) {
            buffer.append(prop.getDescription()).append(" ");
        }

        // ��ʾproperty����
        buffer.append(prop.getName()).append(" = ");

        // ��ʾpropertyֵ
        String value = getPropertyValue(prop, true);

        if (value != null) {
            buffer.append("[").append(value).append("] ");
        }

        print(buffer);

        // �ȴ�����
        String input = null;

        try {
            input = in.readLine();
        } catch (IOException e) {
            throw new ConfigWizardException(e);
        }

        input = (input == null) ? "" : input.trim();

        if ((input == null) || (input.length() == 0)) {
            input = value;
        }

        setProperty(prop.getName(), input);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.antx.config.descriptor.ConfigProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.