Ignore:
Timestamp:
06/26/13 13:27:31 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/core/Instance.java

    r85 r86  
    2323        private static final Logger log = Logger.getLogger(Instance.class.getName());
    2424
    25 
    2625        protected Node root;
    2726
     
    3433        protected void run() {
    3534                super.run();
    36                 root = new Node((CompositeParam)Param.build().name("Instance").id(name).type("o").finish(), null);
     35                root = new Node((CompositeParam) Param.build().name("Instance").id(name).type("o").finish(), null);
    3736                com.framsticks.model.Package.register(registry);
    3837        }
     
    112111        }
    113112
    114 
    115113        protected void fireListChange(Path path, ListChange change) {
    116114                assert isActive();
     
    127125        }
    128126
    129 
    130127        public final FramsClass getInfoFromCache(Path path) {
    131128                return getInfoFromCache(path.getTop().getParam().getContainedTypeName());
    132129        }
    133130
    134 
    135131        public FramsClass getInfoFromCache(String id) {
    136132                assert isActive();
     
    140136        protected Registry registry = new Registry();
    141137
    142         public AccessInterface createAccess(String name) {
     138        public AccessInterface createAccess(String name) throws ConstructionException {
    143139                assert isActive();
    144140                return registry.createAccess(name);
    145141        }
    146 
    147142
    148143        // TODO: make ValueParam
     
    165160        public final AccessInterface bindAccess(Node node) {
    166161                assert node.getObject() != null;
    167                 AccessInterface access = registry.prepareAccess(node.getParam());
    168                 if (access == null) {
    169                         log.error("missing access for: " + node.getParam());
    170                         return null;
    171                 }
    172                 access.select(node.getObject());
    173                 return access;
     162
     163                try {
     164                        return registry.prepareAccess(node.getParam()).select(node.getObject());
     165                } catch (ConstructionException e) {
     166                        log.error("failed to bind access for " + node.getParam() + ": " + e);
     167                }
     168                return null;
    174169        }
    175170
Note: See TracChangeset for help on using the changeset viewer.