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/AccessOperations.java

    r103 r105  
    66import javax.annotation.Nullable;
    77
     8import org.apache.commons.lang3.ClassUtils;
    89import org.apache.logging.log4j.Logger;
    910import org.apache.logging.log4j.LogManager;
     
    1213import com.framsticks.params.types.ListParam;
    1314import com.framsticks.parsers.MultiParamLoader;
     15import com.framsticks.structure.messages.Result;
    1416import com.framsticks.util.FramsticksException;
    1517import com.framsticks.util.FramsticksUnsupportedOperationException;
     
    114116                                        first.set(false);
    115117                                        if (rootAccess != null) {
    116                                                 if (name.equals(rootAccess.getId())) {
     118                                                if (name.equals(rootAccess.getTypeId())) {
    117119                                                        needAdd.set(false);
    118120                                                        currentAccess.set(rootAccess);
     
    224226                if (access instanceof ObjectAccess) {
    225227                        ObjectAccess objectAccess = (ObjectAccess) access;
    226                         FramsClass framsClass = access.getFramsClass();
    227                         assert framsClass != null;
    228228                        boolean headerNeeded = true;
    229229                        // sink.print(framsClass.getId()).print(":").breakLine();
    230                         for (PrimitiveParam<?> p : filterInstanceof(framsClass.getParamEntries(), PrimitiveParam.class)) {
     230                        for (PrimitiveParam<?> p : filterInstanceof(access.getParams(), PrimitiveParam.class)) {
    231231
    232232                                Object value = objectAccess.get(p, Object.class);
     
    236236
    237237                                if (headerNeeded) {
    238                                         sink.print(framsClass.getId()).print(":").breakLine();
     238                                        sink.print(access.getTypeId()).print(":").breakLine();
    239239                                        headerNeeded = false;
    240240                                }
    241241
    242                                 sink.print(p.getId()).print(":");
    243                                 p.save(sink, value);
     242                                String stringValue = p.serialize(value);
     243
     244                                sink.print(p.getId()).print(":").print(stringValue);
     245                                // p.save(sink, stringValue);
    244246                                sink.breakLine();
    245247                        }
     
    414416        }
    415417
     418        public static Object wrapValueInResultIfPrimitive(Object object) {
     419                Class<?> javaClass = object.getClass();
     420                if (ClassUtils.isPrimitiveOrWrapper(javaClass)) {
     421                        return new Result(object);
     422                }
     423                if (javaClass.equals(String.class)) {
     424                        return new Result(object);
     425                }
     426                return object;
     427        }
    416428
    417429        /**
Note: See TracChangeset for help on using the changeset viewer.