com.ctc.wstx.evt.WEntityReference Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of woodstox-core-asl Show documentation
Show all versions of woodstox-core-asl Show documentation
Woodstox is a high-performance XML processor that
implements Stax (JSR-173) and SAX2 APIs
The newest version!
package com.ctc.wstx.evt;
import javax.xml.stream.Location;
import javax.xml.stream.events.EntityReference;
import javax.xml.stream.events.EntityDeclaration;
import org.codehaus.stax2.ri.evt.EntityReferenceEventImpl;
/**
* We need a slightly specialized version to support concept of
* undeclared entities, which can be used in (non-default, non-standard)
* mode where undeclared entities are allowed to be handled.
*/
public class WEntityReference
extends EntityReferenceEventImpl
implements EntityReference
{
final String mName;
public WEntityReference(Location loc, EntityDeclaration decl)
{
super(loc, decl);
mName = null;
}
/**
* This constructor gets called for undeclared/defined entities: we will
* still know the name (from the reference), but not how it's defined
* (since it is not defined).
*/
public WEntityReference(Location loc, String name)
{
super(loc, (EntityDeclaration) null);
mName = name;
}
public String getName()
{
if (mName != null) {
return mName;
}
return super.getName();
}
}