private String consumeAttributeWithParser(String name, AttributeParser parser) throws UnableToCompleteException { String value = parser.parse(this, consumeRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
private String consumeAttributeWithParser(String name, AttributeParser parser) throws UnableToCompleteException { String value = parser.parse(this, consumeRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
private String consumeAttributeWithParser(String name, AttributeParser parser) throws UnableToCompleteException { String value = parser.parse(this, consumeRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
private String consumeAttributeWithParser(String name, AttributeParser parser) throws UnableToCompleteException { String value = parser.parse(this, consumeRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
/** * Like {@link #consumeAttributeWithDefault(String, String, JType)}, but * accommodates more complex type signatures. */ public String consumeAttributeWithDefault(String name, String defaultValue, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { if (defaultValue != null) { designTime.putAttribute(this, name + ".default", defaultValue); } return defaultValue; } AttributeParser parser = attributeParsers.getParser(types); return consumeAttributeWithParser(name, parser); }
/** * Like {@link #consumeAttributeWithDefault(String, String, JType)}, but * accommodates more complex type signatures. */ public String consumeAttributeWithDefault(String name, String defaultValue, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { if (defaultValue != null) { designTime.putAttribute(this, name + ".default", defaultValue); } return defaultValue; } AttributeParser parser = attributeParsers.getParser(types); return consumeAttributeWithParser(name, parser); }
/** * Like {@link #consumeAttributeWithDefault(String, String, JType)}, but * accommodates more complex type signatures. */ public String consumeAttributeWithDefault(String name, String defaultValue, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { if (defaultValue != null) { designTime.putAttribute(this, name + ".default", defaultValue); } return defaultValue; } AttributeParser parser = attributeParsers.getParser(types); return consumeAttributeWithParser(name, parser); }
/** * Like {@link #consumeAttributeWithDefault(String, String, JType)}, but * accommodates more complex type signatures. */ public String consumeAttributeWithDefault(String name, String defaultValue, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { if (defaultValue != null) { designTime.putAttribute(this, name + ".default", defaultValue); } return defaultValue; } AttributeParser parser = attributeParsers.getParser(types); return consumeAttributeWithParser(name, parser); }
/** * Consumes the named attribute and parses it to an array of String * expressions. The strings in the attribute may be comma or space separated * (or a mix of both). * * @return array of String expressions, empty if the attribute was not set. * @throws UnableToCompleteException on unparseable value */ public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException { AttributeParser parser = attributeParsers.getParser(getStringType()); String[] strings = consumeRawArrayAttribute(name); for (int i = 0; i < strings.length; i++) { strings[i] = parser.parse(this, strings[i]); } designTime.putAttribute(this, name, strings); return strings; }
/** * Consumes the named attribute and parses it to an array of String * expressions. The strings in the attribute may be comma or space separated * (or a mix of both). * * @return array of String expressions, empty if the attribute was not set. * @throws UnableToCompleteException on unparseable value */ public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException { AttributeParser parser = attributeParsers.getParser(getStringType()); String[] strings = consumeRawArrayAttribute(name); for (int i = 0; i < strings.length; i++) { strings[i] = parser.parse(this, strings[i]); } designTime.putAttribute(this, name, strings); return strings; }
/** * Consumes the named attribute and parses it to an array of String * expressions. The strings in the attribute may be comma or space separated * (or a mix of both). * * @return array of String expressions, empty if the attribute was not set. * @throws UnableToCompleteException on unparseable value */ public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException { AttributeParser parser = attributeParsers.getParser(getStringType()); String[] strings = consumeRawArrayAttribute(name); for (int i = 0; i < strings.length; i++) { strings[i] = parser.parse(this, strings[i]); } designTime.putAttribute(this, name, strings); return strings; }
/** * Consumes the named attribute and parses it to an array of String * expressions. The strings in the attribute may be comma or space separated * (or a mix of both). * * @return array of String expressions, empty if the attribute was not set. * @throws UnableToCompleteException on unparseable value */ public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException { AttributeParser parser = attributeParsers.getParser(getStringType()); String[] strings = consumeRawArrayAttribute(name); for (int i = 0; i < strings.length; i++) { strings[i] = parser.parse(this, strings[i]); } designTime.putAttribute(this, name, strings); return strings; }
/** * Consumes the given required attribute as a literal or field reference. The * types parameters are required to determine how the value is parsed and * validated. * * @param name the attribute's full name (including prefix) * @param types the type(s) this attribute is expected to provide * @return the attribute's value as a Java expression * @throws UnableToCompleteException on parse failure, or if the attribute is * empty or unspecified */ public String consumeRequiredAttribute(String name, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { failRequired(name); } AttributeParser parser = attributeParsers.getParser(types); String value = parser.parse(this, consumeRequiredRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
/** * Consumes the given required attribute as a literal or field reference. The * types parameters are required to determine how the value is parsed and * validated. * * @param name the attribute's full name (including prefix) * @param types the type(s) this attribute is expected to provide * @return the attribute's value as a Java expression * @throws UnableToCompleteException on parse failure, or if the attribute is * empty or unspecified */ public String consumeRequiredAttribute(String name, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { failRequired(name); } AttributeParser parser = attributeParsers.getParser(types); String value = parser.parse(this, consumeRequiredRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
/** * Consumes the given required attribute as a literal or field reference. The * types parameters are required to determine how the value is parsed and * validated. * * @param name the attribute's full name (including prefix) * @param types the type(s) this attribute is expected to provide * @return the attribute's value as a Java expression * @throws UnableToCompleteException on parse failure, or if the attribute is * empty or unspecified */ public String consumeRequiredAttribute(String name, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { failRequired(name); } AttributeParser parser = attributeParsers.getParser(types); String value = parser.parse(this, consumeRequiredRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }
/** * Consumes the given required attribute as a literal or field reference. The * types parameters are required to determine how the value is parsed and * validated. * * @param name the attribute's full name (including prefix) * @param types the type(s) this attribute is expected to provide * @return the attribute's value as a Java expression * @throws UnableToCompleteException on parse failure, or if the attribute is * empty or unspecified */ public String consumeRequiredAttribute(String name, JType... types) throws UnableToCompleteException { if (!hasAttribute(name)) { failRequired(name); } AttributeParser parser = attributeParsers.getParser(types); String value = parser.parse(this, consumeRequiredRawAttribute(name)); designTime.putAttribute(this, name, value); return value; }