001
014
015 package com.liferay.portal.model.impl;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.model.Country;
020 import com.liferay.portal.model.ListType;
021 import com.liferay.portal.model.Region;
022 import com.liferay.portal.service.CountryServiceUtil;
023 import com.liferay.portal.service.ListTypeServiceUtil;
024 import com.liferay.portal.service.RegionServiceUtil;
025
026
029 public class AddressImpl extends AddressBaseImpl {
030
031 public AddressImpl() {
032 }
033
034 @Override
035 public Country getCountry() {
036 Country country = null;
037
038 try {
039 country = CountryServiceUtil.getCountry(getCountryId());
040 }
041 catch (Exception e) {
042 country = new CountryImpl();
043
044 _log.warn(e);
045 }
046
047 return country;
048 }
049
050 @Override
051 public Region getRegion() {
052 Region region = null;
053
054 try {
055 region = RegionServiceUtil.getRegion(getRegionId());
056 }
057 catch (Exception e) {
058 region = new RegionImpl();
059
060 _log.warn(e);
061 }
062
063 return region;
064 }
065
066 @Override
067 public ListType getType() {
068 ListType type = null;
069
070 try {
071 type = ListTypeServiceUtil.getListType(getTypeId());
072 }
073 catch (Exception e) {
074 type = new ListTypeImpl();
075
076 _log.warn(e);
077 }
078
079 return type;
080 }
081
082 private static Log _log = LogFactoryUtil.getLog(AddressImpl.class);
083
084 }