Package org.apache.james.mime4j.field.address.parser

Examples of org.apache.james.mime4j.field.address.parser.Node


    return new AddressList(list, true);
  }

  private Address buildAddress(ASTaddress node) {
    ChildNodeIterator it = new ChildNodeIterator(node);
    Node n = it.nextNode();
    if (n instanceof ASTaddr_spec) {
      return buildAddrSpec((ASTaddr_spec)n);
    }
    else if (n instanceof ASTangle_addr) {
      return buildAngleAddr((ASTangle_addr)n);
    }
    else if (n instanceof ASTphrase) {
      String name = buildString((ASTphrase)n, false);
      Node n2 = it.nextNode();
      if (n2 instanceof ASTgroup_body) {
        return new Group(name, buildGroupBody((ASTgroup_body)n2));
      }
      else if (n2 instanceof ASTangle_addr) {
                name = DecoderUtil.decodeEncodedWords(name);
View Full Code Here


 
  private MailboxList buildGroupBody(ASTgroup_body node) {
    ArrayList results = new ArrayList();
    ChildNodeIterator it = new ChildNodeIterator(node);
    while (it.hasNext()) {
      Node n = it.nextNode();
      if (n instanceof ASTmailbox)
        results.add(buildMailbox((ASTmailbox)n));
      else
        throw new IllegalStateException();
    }
View Full Code Here

    return new MailboxList(results, true);
  }

  private Mailbox buildMailbox(ASTmailbox node) {
    ChildNodeIterator it = new ChildNodeIterator(node);
    Node n = it.nextNode();
    if (n instanceof ASTaddr_spec) {
      return buildAddrSpec((ASTaddr_spec)n);
    }
    else if (n instanceof ASTangle_addr) {
      return buildAngleAddr((ASTangle_addr)n);
View Full Code Here

    }
  }

  private NamedMailbox buildNameAddr(ASTname_addr node) {
    ChildNodeIterator it = new ChildNodeIterator(node);
    Node n = it.nextNode();
    String name;
    if (n instanceof ASTphrase) {
      name = buildString((ASTphrase)n, false);
    }
    else {
View Full Code Here

  }
 
  private Mailbox buildAngleAddr(ASTangle_addr node) {
    ChildNodeIterator it = new ChildNodeIterator(node);
    DomainList route = null;
    Node n = it.nextNode();
    if (n instanceof ASTroute) {
      route = buildRoute((ASTroute)n);
      n = it.nextNode();
    }
    else if (n instanceof ASTaddr_spec)
View Full Code Here

  private DomainList buildRoute(ASTroute node) {
    ArrayList results = new ArrayList(node.jjtGetNumChildren());
    ChildNodeIterator it = new ChildNodeIterator(node);
    while (it.hasNext()) {
      Node n = it.nextNode();
      if (n instanceof ASTdomain)
        results.add(buildString((ASTdomain)n, true));
      else
        throw new IllegalStateException();
    }
View Full Code Here

        return new AddressList(list, true);
    }

    public Address buildAddress(ASTaddress node) {
        ChildNodeIterator it = new ChildNodeIterator(node);
        Node n = it.next();
        if (n instanceof ASTaddr_spec) {
            return buildAddrSpec((ASTaddr_spec) n);
        } else if (n instanceof ASTangle_addr) {
            return buildAngleAddr((ASTangle_addr) n);
        } else if (n instanceof ASTphrase) {
            String name = buildString((ASTphrase) n, false);
            Node n2 = it.next();
            if (n2 instanceof ASTgroup_body) {
                return new Group(name, buildGroupBody((ASTgroup_body) n2));
            } else if (n2 instanceof ASTangle_addr) {
                name = DecoderUtil.decodeEncodedWords(name);
                return new Mailbox(name, buildAngleAddr((ASTangle_addr) n2));
View Full Code Here

    private MailboxList buildGroupBody(ASTgroup_body node) {
        List<Mailbox> results = new ArrayList<Mailbox>();
        ChildNodeIterator it = new ChildNodeIterator(node);
        while (it.hasNext()) {
            Node n = it.next();
            if (n instanceof ASTmailbox)
                results.add(buildMailbox((ASTmailbox) n));
            else
                throw new IllegalStateException();
        }
View Full Code Here

        return new MailboxList(results, true);
    }

    public Mailbox buildMailbox(ASTmailbox node) {
        ChildNodeIterator it = new ChildNodeIterator(node);
        Node n = it.next();
        if (n instanceof ASTaddr_spec) {
            return buildAddrSpec((ASTaddr_spec) n);
        } else if (n instanceof ASTangle_addr) {
            return buildAngleAddr((ASTangle_addr) n);
        } else if (n instanceof ASTname_addr) {
View Full Code Here

        }
    }

    private Mailbox buildNameAddr(ASTname_addr node) {
        ChildNodeIterator it = new ChildNodeIterator(node);
        Node n = it.next();
        String name;
        if (n instanceof ASTphrase) {
            name = buildString((ASTphrase) n, false);
        } else {
            throw new IllegalStateException();
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.field.address.parser.Node

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.