Package org.apache.james.mime4j.dom.address

Examples of org.apache.james.mime4j.dom.address.Group


                "Marketing  folks :  Jane Smith < jane @ example . net >," +
                " \" Jack \\\"Jackie\\\" Jones \" < jjones@example.com > (comment(comment)); ,, (comment)  ," +
                " <@example . net,@example(ignore\\)).com:(ignore)john@(ignore)example.net>");
        assertEquals(2, addrList.size());

        Group group = (Group)addrList.get(0);
        assertEquals("Marketing folks", group.getName());
        assertEquals(2, group.getMailboxes().size());

        Mailbox mailbox1 = group.getMailboxes().get(0);
        Mailbox mailbox2 = group.getMailboxes().get(1);

        assertEquals("Jane Smith", mailbox1.getName());
        assertEquals("jane", mailbox1.getLocalPart());
        assertEquals("example.net", mailbox1.getDomain());
View Full Code Here


        if (addressList != null && addressList.isEmpty() == false) {
            Address address = addressList.get(0);
            if (address instanceof Mailbox) {
                return getDisplayAddress((Mailbox) address);
            } else if (address instanceof Group) {
                Group group = (Group) address;
                if (group != null) {
                    MailboxList mList = group.getMailboxes();
                    if (mList != null && mList.isEmpty() == false) {
                        return getDisplayAddress(mList.get(0));
                    }
                }
            }
View Full Code Here

    }

    public Group parseGroup(final ByteSequence buf, final ParserCursor cursor) {
        String name = this.parser.parseToken(buf, cursor, COLON_ONLY);
        if (cursor.atEnd()) {
            return new Group(name, Collections.<Mailbox>emptyList());
        }
        int pos = cursor.getPos();
        int current = (char) (buf.byteAt(pos) & 0xff);
        if (current == COLON) {
            cursor.updatePos(pos + 1);
        }
        List<Mailbox> mboxes = parseMailboxes(buf, cursor, SEMICOLON_ONLY);
        return new Group(name, mboxes);
    }
View Full Code Here

                current = (char) (buf.byteAt(pos) & 0xff);
                if (current == SEMICOLON) {
                    cursor.updatePos(pos + 1);
                }
            }
            return new Group(name, mboxes);
        } else {
            return createMailbox(openingText);
        }
    }
View Full Code Here

            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, monitor));
            } else if (n2 instanceof ASTangle_addr) {
                try {
                    name = DecoderUtil.decodeEncodedWords(name, monitor);
                } catch (IllegalArgumentException e) {
                    throw new ParseException(e.getMessage());
View Full Code Here

    }

    public Group parseGroup(final ByteSequence buf, final ParserCursor cursor) {
        String name = this.parser.parseToken(buf, cursor, COLON_ONLY);
        if (cursor.atEnd()) {
            return new Group(name, Collections.<Mailbox>emptyList());
        }
        int pos = cursor.getPos();
        int current = (char) (buf.byteAt(pos) & 0xff);
        if (current == COLON) {
            cursor.updatePos(pos + 1);
        }
        List<Mailbox> mboxes = parseMailboxes(buf, cursor, SEMICOLON_ONLY);
        return new Group(name, mboxes);
    }
View Full Code Here

                current = (char) (buf.byteAt(pos) & 0xff);
                if (current == SEMICOLON) {
                    cursor.updatePos(pos + 1);
                }
            }
            return new Group(openingText, mboxes);
        } else {
            return createMailbox(openingText);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.dom.address.Group

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.