1/**************************************************************** 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 ****************************************************************/ 19 20package org.apache.james.mime4j.field.address; 21 22import java.util.ArrayList; 23 24/** 25 * The abstract base for classes that represent RFC2822 addresses. 26 * This includes groups and mailboxes. 27 * 28 * Currently, no public methods are introduced on this class. 29 * 30 * 31 */ 32public abstract class Address { 33 34 /** 35 * Adds any mailboxes represented by this address 36 * into the given ArrayList. Note that this method 37 * has default (package) access, so a doAddMailboxesTo 38 * method is needed to allow the behavior to be 39 * overridden by subclasses. 40 */ 41 final void addMailboxesTo(ArrayList<Address> results) { 42 doAddMailboxesTo(results); 43 } 44 45 /** 46 * Adds any mailboxes represented by this address 47 * into the given ArrayList. Must be overridden by 48 * concrete subclasses. 49 */ 50 protected abstract void doAddMailboxesTo(ArrayList<Address> results); 51 52} 53