/** * Returns the absolute base URI of this node or null if the implementation * wasn't able to obtain an absolute URI. Note: If the URI is malformed, a * null is returned. * * @return The absolute base URI of this node or null. * @since DOM Level 3 */ public String getBaseURI() { if (needsSyncData()) { synchronizeData(); } return (baseURI!=null)?baseURI:((CoreDocumentImpl)getOwnerDocument()).getBaseURI(); }
/** Factory constructor. */ public EntityImpl(CoreDocumentImpl ownerDoc, String name) { super(ownerDoc); this.name = name; isReadOnly(true); }
/** * NON-DOM * version - An attribute specifying, as part of the text declaration, * the version number of this entity, when it is an external parsed entity. * This is null otherwise */ public void setXmlVersion(String value) { if (needsSyncData()) { synchronizeData(); } version = value; } // setVersion (String)
if (entity == null) { entity = (EntityImpl)fDocumentImpl.createEntity (name); entity.setPublicId (publicId); entity.setSystemId (literalSystemId); entity.setNotationName (notation); entity.setBaseURI (identifier.getBaseSystemId ()); entities.setNamedItem (entity);
EntityImpl newentity = (EntityImpl)createEntity(source.getNodeName()); newentity.setPublicId(srcentity.getPublicId()); newentity.setSystemId(srcentity.getSystemId()); newentity.setNotationName(srcentity.getNotationName()); newentity.isReadOnly(false); newnode = newentity; break;
if (entity == null) { entity = (EntityImpl)fDocumentImpl.createEntity (name); entity.setPublicId (publicId); entity.setSystemId (literalSystemId); entity.setBaseURI (identifier.getBaseSystemId ()); entities.setNamedItem (entity);
Entity oldEntity = (Entity) oldMap.item(i); EntityImpl newEntity = (EntityImpl) fDocumentImpl.createEntity(oldEntity.getNodeName()); newEntity.setPublicId(oldEntity.getPublicId()); newEntity.setSystemId(oldEntity.getSystemId()); newEntity.setNotationName(oldEntity.getNotationName()); newMap.setNamedItem(newEntity);
fCurrentEntityDecl = (EntityImpl) entities.getNamedItem (name); if (fCurrentEntityDecl != null) { if (fCurrentEntityDecl != null && fCurrentEntityDecl.getFirstChild () == null) { fCurrentEntityDecl.setReadOnly (false, true); Node child = fCurrentNode.getFirstChild (); while (child != null) { Node copy = child.cloneNode (true); fCurrentEntityDecl.appendChild (copy); child = child.getNextSibling (); fCurrentEntityDecl.setReadOnly (true, true);
/** * NON-DOM * Factory method; creates an Entity having this Document * as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building * DTD information unspecified.) * * @param name The name of the Entity we wish to provide a value for. * * @throws DOMException(NOT_SUPPORTED_ERR) for HTML documents, where * nonstandard entities are not permitted. (HTML not yet * implemented.) */ public Entity createEntity(String name) throws DOMException { if (errorChecking && !isXMLName(name,xml11Version)) { String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "INVALID_CHARACTER_ERR", null); throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg); } return new EntityImpl(this, name); } // createEntity(String):Entity
if (entity == null) { entity = (EntityImpl)fDocumentImpl.createEntity (name); entity.setBaseURI ((String)fBaseURIStack.peek ()); entities.setNamedItem (entity);
return entDef.getBaseURI();
fCurrentEntityDecl = (EntityImpl) entities.getNamedItem (name); if (fCurrentEntityDecl != null) { fCurrentEntityDecl.setInputEncoding (encoding);
/** * EntityReference's children are a reflection of those defined in the * named Entity. This method creates them if they haven't been created yet. * This doesn't support editing the Entity though, since this only called * once for all. */ protected void synchronizeChildren() { // no need to synchronize again needsSyncChildren(false); DocumentType doctype; NamedNodeMap entities; EntityImpl entDef; if (null != (doctype = getOwnerDocument().getDoctype()) && null != (entities = doctype.getEntities())) { entDef = (EntityImpl)entities.getNamedItem(getNodeName()); // No Entity by this name, stop here. if (entDef == null) return; // If entity's definition exists, clone its kids isReadOnly(false); for (Node defkid = entDef.getFirstChild(); defkid != null; defkid = defkid.getNextSibling()) { Node newkid = defkid.cloneNode(true); insertBefore(newkid, null); } setReadOnly(true, true); } }
/** * DOM Level 3 WD - experimental * the version number of this entity, when it is an external parsed entity. */ public String getXmlVersion() { if (needsSyncData()) { synchronizeData(); } return version; } // getVersion():String
/** * Unparsed entities -- which contain non-XML data -- have a * "notation name" which tells applications how to deal with them. * Parsed entities, which <em>are</em> in XML format, don't need this and * set it to null. */ public String getNotationName() { if (needsSyncData()) { synchronizeData(); } return notationName; } // getNotationName():String
/** * Returns the entity name */ public String getNodeName() { if (needsSyncData()) { synchronizeData(); } return name; }
/** * The public identifier associated with the entity. If not specified, * this will be null. */ public String getPublicId() { if (needsSyncData()) { synchronizeData(); } return publicId; } // getPublicId():String
/** * The system identifier associated with the entity. If not specified, * this will be null. */ public String getSystemId() { if (needsSyncData()) { synchronizeData(); } return systemId; } // getSystemId():String
/** * DOM Level 2: Unparsed entities -- which contain non-XML data -- have a * "notation name" which tells applications how to deal with them. * Parsed entities, which <em>are</em> in XML format, don't need this and * set it to null. */ public void setNotationName(String name) { if (needsSyncData()) { synchronizeData(); } notationName = name; } // setNotationName(String)
/** NON-DOM: set base uri*/ public void setBaseURI(String uri){ if (needsSyncData()) { synchronizeData(); } baseURI = uri; }