private void append(StringBuilder sb, String key, String value) { sb.append(key); Type type = getType(key); if (type != Type.STRING) { sb.append(":") .append(type); } sb.append("="); OSGiHeader.quote(sb, value); }
public static void copyAttribsToBuilder(CapReqBuilder builder, Attrs attribs) { for (Entry<String,String> attrib : attribs.entrySet()) { String key = attrib.getKey(); if (key.endsWith(":")) { String directiveName = key.substring(0, key.length() - 1); builder.addDirective(directiveName, attrib.getValue()); } else { // TODO Type type = attribs.getType(key); Object value = attribs.getTyped(key); builder.addAttribute(key, value); } } }
private void append(StringBuilder sb, String key, String value) { sb.append(key); Type type = getType(key); if (type != Type.STRING) { sb.append(":") .append(type); } sb.append("="); OSGiHeader.quote(sb, value); }
public static void copyAttribsToBuilder(CapReqBuilder builder, Attrs attribs) { for (Entry<String,String> attrib : attribs.entrySet()) { String key = attrib.getKey(); if (key.endsWith(":")) { String directiveName = key.substring(0, key.length() - 1); builder.addDirective(directiveName, attrib.getValue()); } else { // TODO Type type = attribs.getType(key); Object value = attribs.getTyped(key); builder.addAttribute(key, value); } } }
private void append(StringBuilder sb, String key, String value) { sb.append(key); Type type = getType(key); if (type != Type.STRING) { sb.append(":") .append(type); } sb.append("="); OSGiHeader.quote(sb, value); }
private void append(StringBuilder sb, String key, String value) { sb.append(key); Type type = getType(key); if (type != Type.STRING) { sb.append(":") .append(type); } sb.append("="); OSGiHeader.quote(sb, value); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
public Object getTyped(String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); return convert(t, s); }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if (t != type.type()) throw new IllegalArgumentException( "For key " + adname + ", expected " + type.type() + " but had a " + t + ". Value is " + s); return (T) convert(t, s); }
/** * @param attrs */ void verifyAttrs(Attrs attrs) { for (String a : attrs.keySet()) { String v = attrs.get(a); if (!a.endsWith(":")) { Attrs.Type t = attrs.getType(a); if ("version".equals(a)) { if (t != Attrs.Type.VERSION) error("Version attributes should always be of type version, it is %s", t); } else verifyType(t, v); } } }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if (t != type.type()) throw new IllegalArgumentException( "For key " + adname + ", expected " + type.type() + " but had a " + t + ". Value is " + s); return (T) convert(t, s); }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if ( t != type.type()) throw new IllegalArgumentException("For key " + adname + ", expected " + type.type() + " but had a " + t +". Value is " + s); return (T) convert(t, s); }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if (t != type.type()) throw new IllegalArgumentException( "For key " + adname + ", expected " + type.type() + " but had a " + t + ". Value is " + s); return (T) convert(t, s); }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if ( t != type.type()) throw new IllegalArgumentException("For key " + adname + ", expected " + type.type() + " but had a " + t +". Value is " + s); return (T) convert(t, s); }
@SuppressWarnings("unchecked") public <T> T getTyped(DataType<T> type, String adname) { String s = get(adname); if (s == null) return null; Type t = getType(adname); if (t != type.type()) throw new IllegalArgumentException( "For key " + adname + ", expected " + type.type() + " but had a " + t + ". Value is " + s); return (T) convert(t, s); }