Package org.jboss.forge.addon.convert

Examples of org.jboss.forge.addon.convert.Converter


            if (input instanceof SelectComponent)
            {
               result.append(" Valid choices: [");
               Iterable<?> valueChoices = ((SelectComponent) input).getValueChoices();
               Converter itemLabelConverter = ((SelectComponent) input).getItemLabelConverter();
               for (Object choice : valueChoices)
               {
                  if (choice != null)
                  {
                     Object itemLabel = choice.toString();
                     if (itemLabelConverter != null)
                        itemLabel = itemLabelConverter.convert(choice);
                     result.append("\"" + itemLabel + "\" ");
                  }
               }
               result.append("] ");

               if (input.hasDefaultValue() && input.hasValue())
               {
                  result.append(" defaults to: [");
                  if (input instanceof ManyValued)
                  {
                     Iterable values = ((ManyValued) input).getValue();
                     if (values.iterator().hasNext())
                     {
                        for (Object value : values)
                        {
                           if (value != null)
                           {
                              Object itemLabel = value.toString();
                              if (itemLabelConverter != null)
                                 itemLabel = itemLabelConverter.convert(value);
                              result.append("\"" + itemLabel + "\" ");
                           }
                        }
                     }
                     else
                     {
                        Object value = input.getValue();
                        if (value != null)
                        {
                           Object itemLabel = value.toString();
                           if (itemLabelConverter != null)
                              itemLabel = itemLabelConverter.convert(value);
                           result.append("\"" + itemLabel + "\" ");
                        }
                     }
                  }
                  result.append("]");
View Full Code Here


            if (input instanceof SelectComponent)
            {
               result.append(" Valid choices: [");
               Iterable<?> valueChoices = ((SelectComponent) input).getValueChoices();
               Converter itemLabelConverter = ((SelectComponent) input).getItemLabelConverter();
               for (Object choice : valueChoices)
               {
                  if (choice != null)
                  {
                     Object itemLabel = choice.toString();
                     if (itemLabelConverter != null)
                        itemLabel = itemLabelConverter.convert(choice);
                     result.append("\"" + itemLabel + "\" ");
                  }
               }
               result.append("] ");

               if (input.hasDefaultValue() && input.hasValue())
               {
                  result.append(" defaults to: [");
                  if (input instanceof ManyValued)
                  {
                     Iterable values = ((ManyValued) input).getValue();
                     if (values.iterator().hasNext())
                     {
                        for (Object value : values)
                        {
                           if (value != null)
                           {
                              Object itemLabel = value.toString();
                              if (itemLabelConverter != null)
                                 itemLabel = itemLabelConverter.convert(value);
                              result.append("\"" + itemLabel + "\" ");
                           }
                        }
                     }
                     else
                     {
                        Object value = input.getValue();
                        if (value != null)
                        {
                           Object itemLabel = value.toString();
                           if (itemLabelConverter != null)
                              itemLabel = itemLabelConverter.convert(value);
                           result.append("\"" + itemLabel + "\" ");
                        }
                     }
                  }
                  result.append("]");
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.convert.Converter

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.