1
14
15 package com.liferay.portal.model.impl;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.model.Address;
20 import com.liferay.portal.model.Country;
21 import com.liferay.portal.model.ListType;
22 import com.liferay.portal.model.Region;
23 import com.liferay.portal.service.CountryServiceUtil;
24 import com.liferay.portal.service.ListTypeServiceUtil;
25 import com.liferay.portal.service.RegionServiceUtil;
26
27
32 public class AddressImpl extends AddressModelImpl implements Address {
33
34 public AddressImpl() {
35 }
36
37 public Region getRegion() {
38 Region region = null;
39
40 try {
41 region = RegionServiceUtil.getRegion(getRegionId());
42 }
43 catch (Exception e) {
44 region = new RegionImpl();
45
46 _log.warn(e);
47 }
48
49 return region;
50 }
51
52 public Country getCountry() {
53 Country country = null;
54
55 try {
56 country = CountryServiceUtil.getCountry(getCountryId());
57 }
58 catch (Exception e) {
59 country = new CountryImpl();
60
61 _log.warn(e);
62 }
63
64 return country;
65 }
66
67 public ListType getType() {
68 ListType type = null;
69
70 try {
71 type = ListTypeServiceUtil.getListType(getTypeId());
72 }
73 catch (Exception e) {
74 type = new ListTypeImpl();
75
76 _log.warn(e);
77 }
78
79 return type;
80 }
81
82 private static Log _log = LogFactoryUtil.getLog(AddressImpl.class);
83
84 }