01: package com.completex.objective.components.persistency.mapper;
02:
03: import com.completex.objective.components.persistency.PersistentObject;
04:
05: import java.util.HashSet;
06: import java.util.Set;
07: import java.util.Map;
08:
09: /**
10: * @author Gennady Krizhevsky
11: */
12: public class RequestContext {
13: private Object parentBean;
14: private Set seen = new HashSet();
15: private Map typeMap;
16:
17: public RequestContext() {
18: }
19:
20: public RequestContext(Map typeMap) {
21: this .typeMap = typeMap;
22: }
23:
24: public Object getParentBean() {
25: return parentBean;
26: }
27:
28: public void setParentBean(Object parentBean) {
29: if (parentBean != null && this .parentBean == null) {
30: this .parentBean = parentBean;
31: }
32: }
33:
34: public void addToSeen(String valuePath) {
35: seen.add(valuePath);
36: }
37:
38: public boolean isSeen(String valuePath) {
39: return seen.contains(valuePath);
40: }
41:
42: public Map getTypeMap() {
43: return typeMap;
44: }
45:
46: public void setTypeMap(Map typeMap) {
47: this .typeMap = typeMap;
48: }
49:
50: public Class getByFieldName(String name) {
51: return typeMap == null ? null : (Class) typeMap.get(name);
52: }
53:
54: public boolean typeMappingExists(String name) {
55: return getByFieldName(name) != null;
56: }
57:
58: }
|