Package org.apache.abdera.model

Examples of org.apache.abdera.model.Base


    }

    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


    }

    public static Entry republish(Entry entry) {
        if (entry == null)
            return null;
        Base base = entry.getParentElement();
        if (base == null || !(base instanceof Unpublished))
            return null;
        Unpublished unpub = (Unpublished)base;
        Feed feed = unpub.getParentElement();
        Entry newentry = (Entry)entry.clone();
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)
      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

        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

    @Override
    public Object doTransform(Object src, String outputEncoding) throws TransformerException
    {
        try
        {
            final Base e = (Base) src;

            return new OutputHandler()
            {
                public void write(MuleEvent event, OutputStream out) throws IOException
                {
                    FOMWriterOptions opts = new FOMWriterOptions();
                    opts.setCharset(event.getEncoding());
                    e.writeTo(out, opts);
                }
            };
        }
        catch (Exception e)
        {
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

      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

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.