KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > field > TCFieldFactory


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.object.field;
6
7 import com.tc.object.TCClass;
8 import com.tc.object.config.DSOClientConfigHelper;
9 import com.tc.object.config.TransparencyClassSpec;
10
11 import java.lang.reflect.Field JavaDoc;
12 import java.lang.reflect.Modifier JavaDoc;
13
14 /**
15  * @author orion
16  */

17 public class TCFieldFactory {
18   private DSOClientConfigHelper configuration;
19
20   public TCFieldFactory(DSOClientConfigHelper configuration) {
21     this.configuration = configuration;
22   }
23
24   public TCField getInstance(TCClass tcClass, Field JavaDoc field) {
25     TransparencyClassSpec spec = configuration.getSpec(tcClass.getName());
26     boolean trans = false;
27     if (spec != null) {
28       trans = spec.isTransient(field.getModifiers(), field.getName());
29     }
30     return new GenericTCField(tcClass, field, !Modifier.isStatic(field.getModifiers()) && !trans);
31   }
32
33 }
Popular Tags