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

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


                AddressList addressList = LenientAddressBuilder.DEFAULT.parseAddressList(value);
                final int size = addressList.size();
                final List<FetchResponse.Envelope.Address> addresses = new ArrayList<FetchResponse.Envelope.Address>(size);
                for (int i = 0; i < size; i++) {
                    final Address address = addressList.get(i);
                    if (address instanceof Group) {
                        final Group group = (Group) address;
                        addAddresses(group, addresses);

                    } else if (address instanceof org.apache.james.mime4j.dom.address.Mailbox) {
View Full Code Here


            int pos = cursor.getPos();
            int current = (char) (buf.byteAt(pos) & 0xff);
            if (current == COMMA) {
                cursor.updatePos(pos + 1);
            } else {
                Address address = parseAddress(buf, cursor, COMMA_ONLY);
                if (address != null) {
                    addresses.add(address);
                }
            }
        }
View Full Code Here

     * @return a <code>Group</code> object for the specified string.
     * @throws ParseException
     *             if the raw string does not represent a single group address.
     */
    public Group parseGroup(String rawGroupString, DecodeMonitor monitor) throws ParseException {
        Address address = parseAddress(rawGroupString, monitor);
        if (!(address instanceof Group))
            throw new ParseException("Not a group address");

        return (Group) address;
    }
View Full Code Here

    public AddressList buildAddressList(ASTaddress_list node, DecodeMonitor monitor) throws ParseException {
        List<Address> list = new ArrayList<Address>();
        for (int i = 0; i < node.jjtGetNumChildren(); i++) {
            ASTaddress childNode = (ASTaddress) node.jjtGetChild(i);
            Address address = buildAddress(childNode, monitor);
            list.add(address);
        }
        return new AddressList(list, true);
    }
View Full Code Here

        // check route string
        assertEquals(2, dlcopy.flatten().size());
    }

    public void testParseAddress() throws Exception {
        Address address = parser.parseAddress("Mary Smith <mary@example.net>");
        assertTrue(address instanceof Mailbox);
        assertEquals("Mary Smith", ((Mailbox) address).getName());
        assertEquals("mary@example.net", ((Mailbox) address).getAddress());

        address = parser.parseAddress("group: Mary Smith <mary@example.net>;");
View Full Code Here

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }

    public void testParseAddress() throws Exception {
        Address address = parser.parseAddress("Mary Smith <mary@example.net>");
        assertTrue(address instanceof Mailbox);
        Mailbox mbox = (Mailbox) address;
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
View Full Code Here

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }

    public void testParseAddress() throws Exception {
        Address address = parser.parseAddress("Mary Smith <mary@example.net>");
        assertTrue(address instanceof Mailbox);
        Mailbox mbox = (Mailbox) address;
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
View Full Code Here

        // check route string
        assertEquals(2, dlcopy.flatten().size());
    }

    public void testParseAddress() throws Exception {
        Address address = parser.parseAddress("Mary Smith <mary@example.net>");
        assertTrue(address instanceof Mailbox);
        assertEquals("Mary Smith", ((Mailbox) address).getName());
        assertEquals("mary@example.net", ((Mailbox) address).getAddress());

        address = parser.parseAddress("group: Mary Smith <mary@example.net>;");
View Full Code Here

        MailboxList mailboxes = group.getMailboxes();
        assertEquals(0, mailboxes.size());
    }

    public void testParseAddress() throws Exception {
        Address address = parser.parseAddress("Mary Smith <mary@example.net>");
        assertTrue(address instanceof Mailbox);
        Mailbox mbox = (Mailbox) address;
        assertEquals("Mary Smith", mbox.getName());
        assertEquals("mary@example.net", mbox.getAddress());
View Full Code Here

            final String name = header.getName();
            if (headerName.equalsIgnoreCase(name)) {
                final String value = header.getValue();
                AddressList aList = LenientAddressBuilder.DEFAULT.parseAddressList(value);
                for (int i = 0; i < aList.size(); i++) {
                    Address address = aList.get(i);
                    if (address instanceof Mailbox) {
                        if (AddressFormatter.DEFAULT.encode((Mailbox) address).toUpperCase(Locale.ENGLISH)
                                .contains(text)) {
                            return true;
                        }
View Full Code Here

TOP

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

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.