1 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 ; 12 import java.lang.reflect.Modifier ; 13 14 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 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 |