Exemplo n.º 1
0
 /*package*/ void fillAttributes(XMLStreamReader in) {
   for (int i = in.getAttributeCount() - 1; i >= 0; i--) {
     String n = in.getAttributeLocalName(i);
     if (model.attributes.containsKey(n)) {
       if (attributes == null) attributes = new HashMap<String, String>();
       attributes.put(n, in.getAttributeValue(i));
     }
   }
   if (attributes == null) attributes = Collections.emptyMap();
 }
Exemplo n.º 2
0
  protected void _resolve() {
    _resolveBindings(_contextClass);

    // finally: may have root level type info too
    if (_contextType != null) {
      int count = _contextType.containedTypeCount();
      if (count > 0) {
        if (_bindings == null) {
          _bindings = new LinkedHashMap<String, JavaType>();
        }
        for (int i = 0; i < count; ++i) {
          String name = _contextType.containedTypeName(i);
          JavaType type = _contextType.containedType(i);
          _bindings.put(name, type);
        }
      }
    }

    // nothing bound? mark with empty map to prevent further calls
    if (_bindings == null) {
      _bindings = Collections.emptyMap();
    }
  }
Exemplo n.º 3
0
 @Nonnull
 Map<Class<?>, byte[]> getRedefinedClasses() {
   return redefinedClasses.isEmpty()
       ? Collections.<Class<?>, byte[]>emptyMap()
       : new HashMap<Class<?>, byte[]>(redefinedClasses);
 }