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

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


    }

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


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

    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

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.