public String toString() { final StringBuffer sb = new StringBuffer(64).append('[') .append(this instanceof NativeInfo ? "NativeInfo" : "ComponentInfo"); if (_compdef != null) sb.append(": ").append(_compdef.getName()); if (_tag != null) sb.append(" <").append(_tag).append('>'); return sb.append(']').toString(); }
/*package*/ static boolean matchType(Component component, String type) { if (type == null) return true; return component.getDefinition().getName().toLowerCase(java.util.Locale.ENGLISH) .equals(type.toLowerCase(java.util.Locale.ENGLISH)); }
public String getType() { return comp.getDefinition().getName(); }
/*package*/ static boolean matchType(Component component, String type){ if(type == null) return true; return component.getDefinition().getName().toLowerCase().equals(type.toLowerCase()); }
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); final LanguageDefinition langdef = _compdef.getLanguageDefinition(); if (langdef != null) { s.writeObject(langdef.getName()); s.writeObject(_compdef.getName()); } else { s.writeObject(_compdef); } }
/** Adds a component definition to this map. * * <p>Thread safe. */ public void add(ComponentDefinition compdef) { if (compdef == null) throw new IllegalArgumentException("null"); String name = compdef.getName(); if (isCaseInsensitive()) name = name.toLowerCase(java.util.Locale.ENGLISH); Object implcls = compdef.getImplementationClass(); if (implcls instanceof Class) implcls = ((Class) implcls).getName(); synchronized (this) { if (_compdefs == null) { _compdefsByClass = Collections.synchronizedMap(new HashMap<String, ComponentDefinition>(4)); _compdefs = Collections.synchronizedMap(new HashMap<String, ComponentDefinition>(4)); } _compdefs.put(name, compdef); _compdefsByClass.put((String) implcls, compdef); } }
if (langdef != null) { s.writeObject(langdef.getName()); s.writeObject(_def.getName()); } else { s.writeObject(_def);
public JSONObject toJSON() { JSONObject json = new JSONObject(); putEssential(json, "type", _type); if (_comp != null) { put(json, "widget", _comp.getDefinition().getName()); put(json, "uuid", _comp.getUuid()); put(json, "id", _comp.getId()); } put(json, "subtype", _subtype); put(json, "note", toString(_note, 300)); put(json, "location", _location); return json; }