use of org.dbflute.dbmeta.info.ReferrerInfo in project dbflute-core by dbflute.
the class AbstractDBMeta method getReferrerInfoList.
/**
* {@inheritDoc}
*/
public List<ReferrerInfo> getReferrerInfoList() {
if (_referrerInfoList != null) {
return _referrerInfoList;
}
synchronized (this) {
if (_referrerInfoList != null) {
return _referrerInfoList;
}
final Method[] methods = this.getClass().getMethods();
final List<ReferrerInfo> workingList = newArrayList();
final String prefix = "referrer";
final Class<ReferrerInfo> returnType = ReferrerInfo.class;
for (Method method : methods) {
if (method.getName().startsWith(prefix) && returnType.equals(method.getReturnType())) {
workingList.add((ReferrerInfo) DfReflectionUtil.invoke(method, this, null));
}
}
_referrerInfoList = Collections.unmodifiableList(workingList);
return _referrerInfoList;
}
}
use of org.dbflute.dbmeta.info.ReferrerInfo in project dbflute-core by dbflute.
the class AbstractDBMeta method findReferrerInfo.
/**
* {@inheritDoc}
*/
public ReferrerInfo findReferrerInfo(String referrerPropertyName) {
assertStringNotNullAndNotTrimmedEmpty("referrerPropertyName", referrerPropertyName);
final Map<String, ReferrerInfo> flexibleMap = getReferrerInfoFlexibleMap();
final ReferrerInfo referrerInfo = flexibleMap.get(referrerPropertyName);
if (referrerInfo == null) {
final String notice = "The referrer info was not found.";
final String keyName = "Referrer Property";
throwDBMetaNotFoundException(notice, keyName, referrerPropertyName, flexibleMap.keySet());
}
return referrerInfo;
}
use of org.dbflute.dbmeta.info.ReferrerInfo in project dbflute-core by dbflute.
the class AbstractDBMeta method getReferrerInfoFlexibleMap.
/**
* Get the flexible map of referrer information.
* @return The flexible map of referrer information. (NotNull, EmptyAllowed, ReadOnly)
*/
protected Map<String, ReferrerInfo> getReferrerInfoFlexibleMap() {
if (_referrerInfoFlexibleMap != null) {
return _referrerInfoFlexibleMap;
}
final List<ReferrerInfo> referrerInfoList = getReferrerInfoList();
synchronized (this) {
if (_referrerInfoFlexibleMap != null) {
return _referrerInfoFlexibleMap;
}
final StringKeyMap<ReferrerInfo> map = createFlexibleConcurrentMap();
for (ReferrerInfo referrerInfo : referrerInfoList) {
map.put(referrerInfo.getReferrerPropertyName(), referrerInfo);
}
_referrerInfoFlexibleMap = Collections.unmodifiableMap(map);
return _referrerInfoFlexibleMap;
}
}
Aggregations