Package org.apache.abdera.model

Examples of org.apache.abdera.model.Element.discard()


    if (!(position instanceof Point))
      throw new IllegalArgumentException("The W3C Encoding only supports Points");
    Element el = entry.getExtension(QNAME_W3C_LAT);
    if (el != null) el.discard();
    el = entry.getExtension(QNAME_W3C_LONG);
    if (el != null) el.discard();   
    Point point = (Point) position;
   
    ExtensibleElement p = entry.addExtension(QNAME_W3C_POINT);
    p.addSimpleExtension(QNAME_W3C_LAT, Double.toString(point.getCoordinate().getLatitude()));
    p.addSimpleExtension(QNAME_W3C_LONG, Double.toString(point.getCoordinate().getLongitude()));
View Full Code Here


      } else {
        addSimpleExtension(CODE,Integer.toString(code));
      }
    } else {
      Element element = getExtension(CODE);
      if (element != null) element.discard();
    }
  }
  public String getMessage() {
    return getSimpleExtension(MESSAGE);
View Full Code Here

      } else {
        addSimpleExtension(MESSAGE,message);
      }
    } else {
      Element element = getExtension(MESSAGE);
      if (element != null) element.discard();
    }
  }
 
  public void throwException() {
    throw new ProtocolException(this);
View Full Code Here

 
  private static void addW3CPosition(ExtensibleElement element, Position position) {
    if (!(position instanceof Point))
      throw new IllegalArgumentException("The W3C Encoding only supports Points");
    Element el = element.getExtension(QNAME_W3C_LAT);
    if (el != null) el.discard();
    el = element.getExtension(QNAME_W3C_LONG);
    if (el != null) el.discard();   
    Point point = (Point) position;
   
    ExtensibleElement p = element.addExtension(QNAME_W3C_POINT);
View Full Code Here

    if (!(position instanceof Point))
      throw new IllegalArgumentException("The W3C Encoding only supports Points");
    Element el = element.getExtension(QNAME_W3C_LAT);
    if (el != null) el.discard();
    el = element.getExtension(QNAME_W3C_LONG);
    if (el != null) el.discard();   
    Point point = (Point) position;
   
    ExtensibleElement p = element.addExtension(QNAME_W3C_POINT);
    p.addSimpleExtension(QNAME_W3C_LAT, Double.toString(point.getCoordinate().getLatitude()));
    p.addSimpleExtension(QNAME_W3C_LONG, Double.toString(point.getCoordinate().getLongitude()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.