Package org.apache.abdera.model

Examples of org.apache.abdera.model.Element


  }
 
  @Override
  public String getLanguage() {
    if (Type.XHTML.equals(type)) {
      Element el = getValueElement();
      if (el.getAttributeValue(LANG) != null)
        return el.getAttributeValue(LANG);
    }
    return super.getLanguage();
  }
View Full Code Here


  public List<Category> getCategories(String scheme) throws IRISyntaxException {
    return FOMHelper.getCategories(this, scheme);
  }

  public void addCategory(Category category) {
    Element el = category.getParentElement();
    if (el != null && el instanceof Categories) {
      Categories cats = category.getParentElement();
      category = (Category) category.clone();
      try {
        if (category.getScheme() == null && cats.getScheme() != null)
View Full Code Here

  public List<Category> getCategories(String scheme) throws IRISyntaxException {
    return FOMHelper.getCategories(this, scheme);
  }
 
  public void addCategory(Category category) {
    Element el = category.getParentElement();
    if (el != null && el instanceof Categories) {
      Categories cats = category.getParentElement();
      category = (Category) category.clone();
      try {
        if (category.getScheme() == null && cats.getScheme() != null)
View Full Code Here

 
  private Element newExtensionElement(
    QName qname,
    OMContainer parent) {
      String ns = qname.getNamespaceURI();
      Element el = newExtensionElement(qname, parent, null);
      return (ATOM_NS.equals(ns) || APP_NS.equals(ns)) ?
        el : factoriesMap.getElementWrapper(el);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public Element newExtensionElement(
    QName qname,
    OMContainer parent,
    OMXMLParserWrapper parserWrapper) {
    Element element = (parserWrapper == null) ?
      new FOMExtensibleElement(qname, parent, this) :
      new FOMExtensibleElement(qname, parent, this, parserWrapper);
    //return factoriesMap.getElementWrapper(element);
      return element;
  }
View Full Code Here

        } else if (!isFeed && isCollection) {
            reportError("Atom entry can only be created from a single object", null);
        }
        Factory factory = Abdera.getNewFactory();
       
        Element atomElement = null;
        try {
            if (isFeed && !isCollection) {
                atomElement = createFeedFromCollectionWrapper(factory, o, cls);
            } else if (!isFeed && !isCollection) {
                atomElement = createEntryFromObject(factory, o, cls);
View Full Code Here

              OMContainer el = node.getParent();
              if (el instanceof Document) {
                Document doc = (Document) el;
                baseUri = doc.getBaseUri();
              } else if (el instanceof Element) {
                Element element = (Element) el;
                baseUri = element.getBaseUri();
              }
            } else if (o instanceof OMAttribute) {
              OMAttribute attr = (OMAttribute) o;
              Element element = (Element) context.getNavigator().getParentNode(attr);
              baseUri = element.getBaseUri();
            }
            if (baseUri != null) {
              resolved = baseUri.resolve(value);
              results.add(resolved);
            }
View Full Code Here

    assertEquals(generator.getUri().toString(), Version.URI);
    Div div = factory.newDiv();
    assertNotNull(div);
    Document doc = factory.newDocument();
    assertNotNull(doc);
    Element el = factory.newEmail();
    assertNotNull(el);
    el = factory.newEmail();
    el.setText("a");
    assertEquals(el.getText(), "a");
    Entry entry = factory.newEntry();
    assertNotNull(entry);
    entry = factory.newEntry();
    assertNotNull(entry);
    Element ee = factory.newExtensionElement(new QName("urn:foo", "bar", "b"));
    assertNotNull(ee);
    assertEquals(ee.getQName(), new QName("urn:foo", "bar", "b"));
    Feed feed = factory.newFeed();
    assertNotNull(feed);
    generator = factory.newGenerator();
    assertNotNull(generator);
    generator = factory.newGenerator();
View Full Code Here

  }
 
  protected Element domToFom(
    org.w3c.dom.Element element,
    SecurityOptions options) {
    Element el = null;
    if (element != null) {
      try {
        Serializer ser = new XMLSerializer();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ser.setOutputByteStream(out);
View Full Code Here

    super(abdera);
  }
 
  public boolean isEncrypted(
    Document doc) throws SecurityException {
      Element el = doc.getRoot();
      return el.getQName().equals(Constants.ENCRYPTEDDATA);
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Element

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.