src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java

Print this page




 330      * to the Entity contents to be rare, wiping them all out
 331      * and recloning is simplest.
 332      * <P>
 333      * If we expect them to be deep,
 334      * it might be better to first decide which kids (if any)
 335      * persist, and keep the ones (if any) that are unchanged
 336      * rather than doing all the work of cloning them again.
 337      * But that latter gets into having to convolve the two child lists,
 338      * insert new information in the right order (and possibly reorder
 339      * the existing kids), and a few other complexities that I really
 340      * don't want to deal with in this implementation.
 341      * <P>
 342      * Note that if we decide that we need to update the EntityReference's
 343      * contents, we have to turn off the readOnly flag temporarily to do so.
 344      * When we get around to adding multitasking support, this whole method
 345      * should probably be an atomic operation.
 346      *
 347      * @see DocumentTypeImpl
 348      * @see EntityImpl
 349      */
 350     // The Xerces parser invokes callbacks for startEnityReference
 351     // the parsed value of the entity EACH TIME, so it is actually
 352     // easier to create the nodes through the callbacks rather than
 353     // clone the Entity.
 354     /***
 355     // revisit: enable editing of Entity
 356     private void synchronize() {
 357         if (!fEnableSynchronize) {
 358             return;
 359         }
 360         DocumentType doctype;
 361         NamedNodeMap entities;
 362         EntityImpl entDef;
 363         if (null != (doctype = getOwnerDocument().getDoctype()) &&
 364             null != (entities = doctype.getEntities())) {
 365 
 366             entDef = (EntityImpl)entities.getNamedItem(getNodeName());
 367 
 368             // No Entity by this name. If we had a change count, reset it.
 369             if(null==entDef)
 370                 entityChanges=-1;




 330      * to the Entity contents to be rare, wiping them all out
 331      * and recloning is simplest.
 332      * <P>
 333      * If we expect them to be deep,
 334      * it might be better to first decide which kids (if any)
 335      * persist, and keep the ones (if any) that are unchanged
 336      * rather than doing all the work of cloning them again.
 337      * But that latter gets into having to convolve the two child lists,
 338      * insert new information in the right order (and possibly reorder
 339      * the existing kids), and a few other complexities that I really
 340      * don't want to deal with in this implementation.
 341      * <P>
 342      * Note that if we decide that we need to update the EntityReference's
 343      * contents, we have to turn off the readOnly flag temporarily to do so.
 344      * When we get around to adding multitasking support, this whole method
 345      * should probably be an atomic operation.
 346      *
 347      * @see DocumentTypeImpl
 348      * @see EntityImpl
 349      */
 350     // The Xerces parser invokes callbacks for startEntityReference
 351     // the parsed value of the entity EACH TIME, so it is actually
 352     // easier to create the nodes through the callbacks rather than
 353     // clone the Entity.
 354     /***
 355     // revisit: enable editing of Entity
 356     private void synchronize() {
 357         if (!fEnableSynchronize) {
 358             return;
 359         }
 360         DocumentType doctype;
 361         NamedNodeMap entities;
 362         EntityImpl entDef;
 363         if (null != (doctype = getOwnerDocument().getDoctype()) &&
 364             null != (entities = doctype.getEntities())) {
 365 
 366             entDef = (EntityImpl)entities.getNamedItem(getNodeName());
 367 
 368             // No Entity by this name. If we had a change count, reset it.
 369             if(null==entDef)
 370                 entityChanges=-1;