com.github.datalking.beans.BeanMetadataAttributeAccessor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of play-mvc Show documentation
Show all versions of play-mvc Show documentation
simple mvc framework based on java servlet.
The newest version!
package com.github.datalking.beans;
import com.github.datalking.common.AttributeAccessorSupport;
/**
* @author yaoo on 5/29/18
*/
//public class BeanMetadataAttributeAccessor extends AttributeAccessorSupport implements BeanMetadataElement {
public class BeanMetadataAttributeAccessor extends AttributeAccessorSupport {
private Object source;
public void setSource(Object source) {
this.source = source;
}
public Object getSource() {
return this.source;
}
public void addMetadataAttribute(BeanMetadataAttribute attribute) {
super.setAttribute(attribute.getName(), attribute);
}
public BeanMetadataAttribute getMetadataAttribute(String name) {
return (BeanMetadataAttribute) super.getAttribute(name);
}
@Override
public void setAttribute(String name, Object value) {
super.setAttribute(name, new BeanMetadataAttribute(name, value));
}
@Override
public Object getAttribute(String name) {
BeanMetadataAttribute attribute = (BeanMetadataAttribute) super.getAttribute(name);
return (attribute != null ? attribute.getValue() : null);
}
@Override
public Object removeAttribute(String name) {
BeanMetadataAttribute attribute = (BeanMetadataAttribute) super.removeAttribute(name);
return (attribute != null ? attribute.getValue() : null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy