Package javax.xml.stream.events

Examples of javax.xml.stream.events.EntityReference


/*     */     throws XMLStreamException
/*     */   {
/* 463 */     XMLEvent event = reader.peek();
/*     */
/* 465 */     if (event.isEntityReference()) {
/* 466 */       EntityReference entityRef = (EntityReference)reader.nextEvent();
/*     */
/* 468 */       return createEntity(entityRef);
/*     */     }
/* 470 */     throw new XMLStreamException("Expected EntityRef event, found: " + event);
/*     */   }
View Full Code Here


        break;
      case XMLStreamConstants.END_ELEMENT:
        theEventWriter.writeEndElement();
        break;
      case XMLStreamConstants.ENTITY_REFERENCE:
        EntityReference er = (EntityReference) event;
        theEventWriter.writeEntityRef(er.getName());
        break;
      case XMLStreamConstants.NAMESPACE:
        Namespace ns = (Namespace) event;
        theEventWriter.writeNamespace(ns.getPrefix(), ns.getNamespaceURI());
        break;
View Full Code Here

    if (o == null)
      return false;
    if (this == o)
      return true;

    EntityReference entity = (EntityReference) o;
   
    return getName().equals(entity.getName()) &&
           getDeclaration().equals(entity.getDeclaration());
  }
View Full Code Here

    verify(event, XMLStreamConstants.END_DOCUMENT, "");
  }

  @Test
  public void testCreateEntityReference() throws XMLStreamException {
    EntityReference event = factory.createEntityReference("foo", null);
    verify(event, XMLStreamConstants.ENTITY_REFERENCE, "&foo;");
  }
View Full Code Here

    if (o == null)
      return false;
    if (this == o)
      return true;

    EntityReference entity = (EntityReference) o;
   
    return getName().equals(entity.getName()) &&
           getDeclaration().equals(entity.getDeclaration());
  }
View Full Code Here

        if (o == this) return true;
        if (o == null) return false;

        if (!(o instanceof EntityReference)) return false;

        EntityReference other = (EntityReference) o;
        return getName().equals(other.getName());
    }
View Full Code Here

TOP

Related Classes of javax.xml.stream.events.EntityReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.