Ignore:
Timestamp:
09/10/13 21:11:41 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • import refactorization: move Tree, Path, etc.

from core to structure package

  • initial serialization implementation
  • improve PrimeExperiment? test
  • many organizational changes and convenience improvements

CHANGELOG:
Make registry in AbstractTree? final.

Move most classes from core to structure package.

Minor changes.

Switch names of Future and FutureHandler?.

Rename ExceptionResultHandler? to ExceptionHandler?.

Rename ExceptionHandler? to ExceptionDispatcherHandler?.

Fix bug in ParamCandidate? cache.

Add missing synchronization to the BufferedDispatcher?.

Develop @Serialized support.

Rework serialization further.

Add serialization/deserialization interface to ValueParam?.

Move getStorageType and isNumeric from Param down to params hierarchy.

Minor changes.

Improve param type induction.

Add TestSerializedClass? for testing new serialization.

Add info files gor GenePool? and Population.

Add standard.expt exemplary netfile.

Add type name field to PropertiesObject?.

Use PropertiesObject? for PropertiesAccess? instead of ordinary map.

Hide getFramsClass is several more places.

More unification accross FramsClass?, Access and Path.

Add ParamCollection?.

Simplify interface for getting params from FramsClass?, Access
or Path.

Make Access.call() interface variadic.

Add arguments(args) convenience wrapper around new Object[] {args}.

Upgrade to apache.commons.lang version 3.1

Minor improvement with Response constructors.

Develop proper result printing in ClientAtServer?.

Add experimentNetsave to PrimeExperiment?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/ParamCandidate.java

    r102 r105  
    7979        protected final OneTime<Method> adder = new OneTime<>("adder");
    8080        protected final OneTime<Method> remover = new OneTime<>("remover");
     81        protected final OneTime<Class<? extends Param>> paramType = new OneTime<>("paramType");
     82
    8183        protected int flags = 0;
    8284
     
    262264        }
    263265
     266        // public static <T extends Param> boolean isParamAnnorationOfTypeOrUnspecified(ParamAnnotation paramAnnotation, Class<T> paramType) {
     267        //      return paramAnnotation.paramType().equals(Param.class) || paramAnnotation.paramType().equals(paramType);
     268        // }
     269
     270        // public static <T extends Param> boolean isParamAnnorationOfType(ParamAnnotation paramAnnotation, Class<T> paramType) {
     271        //      return paramAnnotation.paramType().equals(paramType);
     272        // }
     273
    264274        void add(ParamAnnotation paramAnnotation, Member member, String name) {
    265275                this.name.set(name);
    266276                annotations.add(paramAnnotation);
    267277                flags |= paramAnnotation.flags();
     278                if (!paramAnnotation.paramType().equals(Param.class)) {
     279                        paramType.set(paramAnnotation.paramType());
     280                }
    268281                if (member instanceof Field) {
    269282                        field.set((Field) member);
     
    273286                if (member instanceof Method) {
    274287                        Method m = (Method) member;
    275                         if (!paramAnnotation.paramType().equals(Param.class)) {
    276                                 if (paramAnnotation.paramType().equals(ProcedureParam.class)) {
    277                                         caller.set(m);
    278                                         return;
    279                                 }
    280                                 throw new ConstructionException().msg("explicit set of paramType different than ProcedureParam is not yet supported").arg("name", name).arg("method", m).arg("in", this);
     288                        if (paramAnnotation.paramType().equals(ProcedureParam.class)) {
     289                                caller.set(m);
     290                                return;
    281291                        }
    282292                        Type[] ps = m.getGenericParameterTypes();
     
    392402        protected static final Map<Class<?>, Set> setsCache = Collections.synchronizedMap(new IdentityHashMap<Class<?>, Set>());
    393403
    394         public static Set getAllCandidates(Class<?> javaClass) throws ConstructionException {
     404        public static Set getAllCandidates(final Class<?> javaClass) throws ConstructionException {
    395405                Set result = setsCache.get(javaClass);
    396406                if (result != null) {
     
    399409
    400410                List<Class<?>> javaClasses = new LinkedList<>();
    401                 while (javaClass != null) {
    402                         javaClasses.add(0, javaClass);
    403                         javaClass = javaClass.getSuperclass();
     411                Class<?> jc = javaClass;
     412                while (jc != null) {
     413                        javaClasses.add(0, jc);
     414                        jc = jc.getSuperclass();
    404415                }
    405416
     
    473484                //      throw new ConstructionException().msg("void is not a valid type");
    474485                // }
     486
    475487
    476488                if (type instanceof ParameterizedType) {
     
    562574        }
    563575
    564 
    565576        public ParamBuilder induceParamType(ParamBuilder builder) {
    566577                Method method = getCaller();
    567578                if (method == null) {
     579                        if (paramType.has()) {
     580                                return builder.type(paramType.get());
     581                        }
    568582                        return induceParamType(builder, getType());
    569583                }
Note: See TracChangeset for help on using the changeset viewer.