Files
Brainstorm/Foundation Test/src/com/foundation/controller/test/AddressController.java
2014-05-30 10:31:51 -07:00

51 lines
1.5 KiB
Java

package com.foundation.controller.test;
import com.common.util.*;
import com.foundation.metadata.Attribute;
import com.foundation.util.*;
import com.foundation.controller.*;
/**
* Copyright Wynne Crisman 1999,2003<p>
*/
public class AddressController extends Controller {
public static final Attribute ADDRESSES = registerAttribute(AddressController.class, "addresses");
/**
* AddressController constructor.
*/
public AddressController() {
super();
IList addresses = new ManagedList();
Address address = null;
address = new Address();
address.setCity("San Francisco");
address.setCountry("United States");
address.setLine1("291 32nd Ave");
address.setLine2("");
address.setPostalCode("94121");
address.setState("California");
addresses.add(address);
setAddresses(addresses);
}//AddressController()//
/**
* Gets a collection of all addresses.
* @return A collection of addresses.
*/
public IList getAddresses() {
return (IList) getAttributeValue(ADDRESSES);
}//getAddresses()//
/**
* Gets the application object that this object is running under. The application object provides the object various services that it will need.
* @return The application reference for the application this object is running under.
*/
public com.foundation.application.IApplication getApplication() {
return TestApplication.getSingleton();
}//getApplication()//
private void setAddresses(IList addresses) {
setAttributeValue(ADDRESSES, addresses);
}//setAddresses()//
}//AddressController//