本文整理汇总了Java中com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl类的典型用法代码示例。如果您正苦于以下问题:Java MutationEventImpl类的具体用法?Java MutationEventImpl怎么用?Java MutationEventImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MutationEventImpl类属于com.sun.org.apache.xerces.internal.dom.events包,在下文中一共展示了MutationEventImpl类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: modifiedCharacterData
import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; //导入依赖的package包/类
/**
* A method to be called when a character data node has been modified
*/
void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) {
if (mutationEvents) {
if (!replace) {
// MUTATION POST-EVENTS:
LCount lc =
LCount.lookup(MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED);
if (lc.total > 0) {
MutationEvent me = new MutationEventImpl();
me.initMutationEvent(
MutationEventImpl.DOM_CHARACTER_DATA_MODIFIED,
true, false, null,
oldvalue, value, null, (short) 0);
dispatchEvent(node, me);
}
// Subroutine: Transmit DOMAttrModified and DOMSubtreeModified,
// if required. (Common to most kinds of mutation)
dispatchAggregateEvents(node, savedEnclosingAttr);
} // End mutation postprocessing
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:DocumentImpl.java
示例2: removedAttrNode
import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; //导入依赖的package包/类
/**
* A method to be called when an attribute node has been removed
*/
void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) {
// We can't use the standard dispatchAggregate, since it assumes
// that the Attr is still attached to an owner. This code is
// similar but dispatches to the previous owner, "element".
if (mutationEvents) {
// If we have to send DOMAttrModified (determined earlier),
// do so.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
MutationEventImpl me= new MutationEventImpl();
me.initMutationEvent(MutationEventImpl.DOM_ATTR_MODIFIED,
true, false, attr,
attr.getNodeValue(), null, name,
MutationEvent.REMOVAL);
dispatchEvent(oldOwner, me);
}
// We can hand off to process DOMSubtreeModified, though.
// Note that only the Element needs to be informed; the
// Attr's subtree has not been changed by this operation.
dispatchAggregateEvents(oldOwner, null, null, (short) 0);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DocumentImpl.java
示例3: saveEnclosingAttr
import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; //导入依赖的package包/类
/**
* NON-DOM INTERNAL: Pre-mutation context check, in
* preparation for later generating DOMAttrModified events.
* Determines whether this node is within an Attr
* @param node node to get enclosing attribute for
* @return either a description of that Attr, or null if none such.
*/
protected void saveEnclosingAttr(NodeImpl node) {
savedEnclosingAttr = null;
// MUTATION PREPROCESSING AND PRE-EVENTS:
// If we're within the scope of an Attr and DOMAttrModified
// was requested, we need to preserve its previous value for
// that event.
LCount lc = LCount.lookup(MutationEventImpl.DOM_ATTR_MODIFIED);
if (lc.total > 0) {
NodeImpl eventAncestor = node;
while (true) {
if (eventAncestor == null)
return;
int type = eventAncestor.getNodeType();
if (type == Node.ATTRIBUTE_NODE) {
EnclosingAttr retval = new EnclosingAttr();
retval.node = (AttrImpl) eventAncestor;
retval.oldvalue = retval.node.getNodeValue();
savedEnclosingAttr = retval;
return;
}
else if (type == Node.ENTITY_REFERENCE_NODE)
eventAncestor = eventAncestor.parentNode();
else if (type == Node.TEXT_NODE)
eventAncestor = eventAncestor.parentNode();
else
return;
// Any other parent means we're not in an Attr
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:DocumentImpl.java
示例4: createEvent
import com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl; //导入依赖的package包/类
/**
* Introduced in DOM Level 2. Optional. <p>
* Create and return Event objects.
*
* @param type The eventType parameter specifies the type of Event
* interface to be created. If the Event interface specified is supported
* by the implementation this method will return a new Event of the
* interface type requested. If the Event is to be dispatched via the
* dispatchEvent method the appropriate event init method must be called
* after creation in order to initialize the Event's values. As an
* example, a user wishing to synthesize some kind of Event would call
* createEvent with the parameter "Events". The initEvent method could then
* be called on the newly created Event to set the specific type of Event
* to be dispatched and set its context information.
* @return Newly created Event
* @exception DOMException NOT_SUPPORTED_ERR: Raised if the implementation
* does not support the type of Event interface requested
* @since WD-DOM-Level-2-19990923
*/
public Event createEvent(String type)
throws DOMException {
if (type.equalsIgnoreCase("Events") || "Event".equals(type))
return new EventImpl();
if (type.equalsIgnoreCase("MutationEvents") ||
"MutationEvent".equals(type))
return new MutationEventImpl();
else {
String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:DocumentImpl.java
注:本文中的com.sun.org.apache.xerces.internal.dom.events.MutationEventImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论