Package org.apache.abdera.model

Examples of org.apache.abdera.model.Base


  }
 
  public boolean getMustPreserveWhitespace() {
    OMAttribute attr = getAttribute(SPACE);
    String space = (attr != null) ? attr.getAttributeValue() : null;
    Base parent = this.getParentElement();
   
    return space != null && space.equalsIgnoreCase("preserve") ? true :
      (parent != null && parent instanceof Element) ?
        ((Element)parent).getMustPreserveWhitespace() :
      (parent != null && parent instanceof Document) ?
View Full Code Here


    }

    private static boolean needToWriteLang(Element element) {
        String parentlang = null;
        if (element.getParentElement() != null) {
            Base parent = element.getParentElement();
            parentlang =
                parent instanceof Document ? ((Document)parent).getLanguage() : ((Element)parent).getLanguage();
        }
        String lang = element.getLanguage();
        return (parentlang == null && lang != null) || (lang != null && parentlang != null && !parentlang
View Full Code Here

    private static boolean needToWriteDir(Element element) {
        Direction parentdir = Direction.UNSPECIFIED;
        Direction dir = BidiHelper.getDirection(element);
        if (element.getParentElement() != null) {
            Base parent = element.getParentElement();
            if (parent instanceof Element)
                parentdir = BidiHelper.getDirection((Element)parent);
        }
        return dir != Direction.UNSPECIFIED && !dir.equals(parentdir);
    }
View Full Code Here

        if (dir != null && dir.length() > 0)
            direction = Direction.valueOf(dir.toUpperCase());
        else if (dir == null) {
            // if the direction is unspecified on this element,
            // let's see if we've inherited it
            Base parent = element.getParentElement();
            if (parent != null && parent instanceof Element)
                direction = getDirection((Element)parent);
        }
        return direction;
    }
View Full Code Here

        if (dir != null && dir.length() > 0)
            return true;
        else if (dir == null) {
            // if the direction is unspecified on this element,
            // let's see if we've inherited it
            Base parent = element.getParentElement();
            if (parent != null && parent instanceof Element)
                return hasDirection((Element)parent);
        }
        return false;
    }
View Full Code Here

        if (base instanceof Source) {
            links = ((Source)base).getLinks(Link.REL_LICENSE);
        } else if (base instanceof Entry) {
            Entry entry = (Entry)base;
            Source source = entry.getSource();
            Base parent = entry.getParentElement();
            links = entry.getLinks(Link.REL_LICENSE);
            if (inherited && (links == null || links.size() == 0) && source != null) {
                links = getLicense(source, false);
            }
            if (inherited && (links == null || links.size() == 0) && parent != null) {
View Full Code Here

        return (lang != null) ? new Lang(lang) : null;
    }

    public String getLanguage() {
        String lang = getAttributeValue(LANG);
        Base parent = this.getParentElement();
        return (lang != null) ? lang : (parent != null && parent instanceof Element) ? ((Element)parent).getLanguage()
            : (parent != null && parent instanceof Document) ? ((Document)parent).getLanguage() : null;
    }
View Full Code Here

        for (Iterator i = this.getAllDeclaredNamespaces(); i.hasNext();) {
            OMNamespace omn = (OMNamespace)i.next();
            if (omn.getNamespaceURI().equals(ns) && (omn.getPrefix() != null && omn.getPrefix().equals(prefix)))
                return true;
        }
        Base parent = this.getParentElement();
        if (parent != null && parent instanceof FOMElement) {
            return ((FOMElement)parent).isDeclared(ns, prefix);
        } else
            return false;
    }
View Full Code Here

    }

    public boolean getMustPreserveWhitespace() {
        OMAttribute attr = getAttribute(SPACE);
        String space = (attr != null) ? attr.getAttributeValue() : null;
        Base parent = this.getParentElement();

        return space != null && space.equalsIgnoreCase("preserve") ? true
            : (parent != null && parent instanceof Element) ? ((Element)parent).getMustPreserveWhitespace()
                : (parent != null && parent instanceof Document) ? ((Document)parent).getMustPreserveWhitespace()
                    : true;
View Full Code Here

    }

    public static Entry unpublish(Entry entry) {
        if (entry == null)
            return null;
        Base base = entry.getParentElement();
        if (base == null || !(base instanceof Feed))
            return null;
        Feed feed = (Feed)base;
        Unpublished unpub = getUnpublished(feed, true);
        Entry newentry = (Entry)entry.clone();
View Full Code Here

TOP

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

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.