flex.messaging.io.ASObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amf Show documentation
Show all versions of amf Show documentation
Amf deserializer used by ats-core component to share data
/*
* www.openamf.org
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package flex.messaging.io;
import java.util.HashMap;
public class ASObject extends HashMap {
private static final long serialVersionUID = 1L;
private String type;
public ASObject() {
super();
}
public ASObject(String type) {
super();
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public boolean containsKey(Object key) {
return super.containsKey(toLowerCase(key));
}
@Override
public Object get(Object key) {
return super.get(toLowerCase(key));
}
@Override
public Object put(String key, Object value) {
return super.put((String)toLowerCase(key), value);
}
@Override
public Object remove(Object key) {
return super.remove(toLowerCase(key));
}
private Object toLowerCase(Object key) {
return key;
}
public Object instantiate() {
Object ret;
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Class> clazz = loader.loadClass(type);
ret = clazz.newInstance();
} catch (Exception e) {
ret = null;
}
return ret;
}
@Override
public String toString() {
return "ASObject[type=" + getType() + "," + super.toString() + "]";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy