/** * Returns a builder for a property having as value a list of decimal numbers. The * format of the individual items is the same as for {@linkplain #doubleProperty(String) doubleProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Double, List<Double>> doubleListProperty(String name) { return doubleProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
/** * Returns a builder for a property having as value a list of long integers. The * format of the individual items is the same as for {@linkplain #longIntProperty(String)} longIntProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Long, List<Long>> longIntListProperty(String name) { return longIntProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
/** * Returns a builder for a property having as value a list of integers. The * format of the individual items is the same as for {@linkplain #intProperty(String) intProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Integer, List<Integer>> intListProperty(String name) { return intProperty(name).toList().delim(MultiValuePropertyDescriptor.DEFAULT_NUMERIC_DELIMITER); }
private ValueParser<?> getValueParser(PropertyTypeId typeId) { ValueParser<?> parser = typeId.getValueParser(); if (typeId.isPropertyMultivalue()) { char delimiter = typeId.isPropertyNumeric() ? DEFAULT_NUMERIC_DELIMITER : DEFAULT_DELIMITER; parser = ValueParserConstants.multi(parser, delimiter); } return parser; }
/** * Returns a builder for a property having as value a list of {@code <T>}. The * format of the individual items is the same as for {@linkplain #enumProperty(String, Map)}. * * @param name Name of the property to build * @param nameToValue Map of labels to values. The null key is ignored. * @param <T> Value type of the property * * @return A new builder */ public static <T> GenericCollectionPropertyBuilder<T, List<T>> enumListProperty(String name, Map<String, T> nameToValue) { return enumProperty(name, nameToValue).toList().delim(MultiValuePropertyDescriptor.DEFAULT_DELIMITER); }
public EcmascriptParserOptions() { this.recordingComments = RECORDING_COMMENTS_DESCRIPTOR.defaultValue(); this.recordingLocalJsDocComments = RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR.defaultValue(); this.rhinoLanguageVersion = RHINO_LANGUAGE_VERSION.defaultValue(); }
/** * Specify a default value. * * @param val List of values * * @return The same builder */ @SuppressWarnings("unchecked") public GenericCollectionPropertyBuilder<V, C> defaultValue(Collection<? extends V> val) { super.defaultValue(getDefaultValue(val)); return this; }
/** * Returns a builder for a property having as value a list of strings. The * format of the individual items is the same as for {@linkplain #stringProperty(String) stringProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<String, List<String>> stringListProperty(String name) { return stringProperty(name).toList(); }
/** * Returns a builder for a property having as value a list of characters. The * format of the individual items is the same as for {@linkplain #charProperty(String) charProperty}. * * @param name Name of the property to build * * @return A new builder */ public static GenericCollectionPropertyBuilder<Character, List<Character>> charListProperty(String name) { return charProperty(name).toList(); }
private <T> String errorForPropCapture(PropertyDescriptor<T> descriptor) { return descriptor.errorFor(getProperty(descriptor)); } }
/** * Parses a String into a Character. * * @param charStr String to parse * * @return Parsed Character * @throws IllegalArgumentException if the String doesn't have length 1 */ public static Character charFrom(String charStr) { return CHARACTER_PARSER.valueOf(charStr); }
static PropertyDescriptorBuilderConversionWrapper.SingleValue.Numeric<Double, DoublePBuilder> extractor() { return new PropertyDescriptorBuilderConversionWrapper.SingleValue.Numeric<Double, DoublePBuilder>(Double.class, ValueParserConstants.DOUBLE_PARSER) { @Override protected DoublePBuilder newBuilder(String name) { return new DoublePBuilder(name); } }; }
static PropertyDescriptorBuilderConversionWrapper.MultiValue<String, StringMultiPBuilder> extractor() { return new PropertyDescriptorBuilderConversionWrapper.MultiValue<String, StringMultiPBuilder>(String.class, ValueParserConstants.STRING_PARSER) { @Override protected StringMultiPBuilder newBuilder(String name) { return new StringMultiPBuilder(name); } }; }
@Override public FloatMultiProperty build() { return new FloatMultiProperty(name, description, lowerLimit, upperLimit, defaultValues, uiOrder, isDefinedInXML); } }
@Override public MethodProperty build() { return new MethodProperty(name, description, defaultValue, legalPackageNames, uiOrder, isDefinedInXML); } }
@Override public RegexProperty build() { return new RegexProperty(this.name, this.description, this.defaultValue, this.uiOrder, isDefinedInXML); } }
static PropertyDescriptorBuilderConversionWrapper.SingleValue.Packaged<Class, TypePBuilder> extractor() { return new PropertyDescriptorBuilderConversionWrapper.SingleValue.Packaged<Class, TypePBuilder>(Class.class, ValueParserConstants.CLASS_PARSER) { @Override protected TypePBuilder newBuilder(String name) { return new TypePBuilder(name); } }; }
@Override public String errorFor(List<V> values) { String err; for (V value2 : values) { err = valueErrorFor(value2); if (err != null) { return err; } } return null; }
@Override public DoubleMultiProperty build() { return new DoubleMultiProperty(name, description, lowerLimit, upperLimit, defaultValues, uiOrder, isDefinedInXML); } }
static PropertyDescriptorBuilderConversionWrapper.SingleValue<String, StringPBuilder> extractor() { return new PropertyDescriptorBuilderConversionWrapper.SingleValue<String, StringPBuilder>(String.class, ValueParserConstants.STRING_PARSER) { @Override protected StringPBuilder newBuilder(String name) { return new StringPBuilder(name); } }; }