attributechangedevent.java

来自「很棒的web服务器源代码」· Java 代码 · 共 71 行

JAVA
71
字号
// AttributeChangedEvent.java// $Id: AttributeChangedEvent.java,v 1.8 2000/08/16 21:37:53 ylafon Exp $  // (c) COPYRIGHT MIT and INRIA, 1997.// Please first read the full copyright statement in file COPYRIGHT.htmlpackage org.w3c.tools.resources.event;import org.w3c.tools.resources.Attribute;import org.w3c.tools.resources.InvalidResourceException;import org.w3c.tools.resources.Resource;import org.w3c.tools.resources.ResourceReference;public class AttributeChangedEvent extends ResourceEvent {    /**     * The index of the attribut modified.     */    protected Attribute attr;    /**     * The attribut new value.     */    protected Object newvalue = null;     public Attribute getAttribute() {	return attr;    }    public Object getNewValue() {	return newvalue;    }    public String toString() {	ResourceReference rr = (ResourceReference) getSource();	String ssource = null;	String id = null;	try {	    Resource resource = rr.lock();	    ssource = resource.getURLPath();	    id = resource.getIdentifier();	} catch (InvalidResourceException ex) {	    ssource = "invalid";	} catch (Exception ex) {	    ssource = "invalid";		} finally {	    rr.unlock();	}	return ("AttributeChangedEvent : ["+ssource+		" ("+id+")"+		" : "+attr.getName()+		" <- "+newvalue+"]");    }    /**     * Create an attribute change event.     * @param source The resource whose attribute has changed.     * @param idx The index of the attribute that has changed.     * @param newvalue The new attribuyte value.     */    public AttributeChangedEvent(ResourceReference ref, 				 Attribute attr, 				 Object newvalue)     {	super(ref, Events.ATTRIBUTE_EVENT);	this.attr = attr;	this.newvalue = newvalue;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?