source: java/main/src/main/java/com/framsticks/parsers/Savers.java @ 86

Last change on this file since 86 was 86, checked in by psniegowski, 11 years ago

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 size: 575 bytes
Line 
1package com.framsticks.parsers;
2
3import com.framsticks.params.*;
4import com.framsticks.params.SinkInterface;
5
6/**
7 * @author Piotr Sniegowski
8 */
9public class Savers {
10        public static void saveFramsClass(SinkInterface sink, FramsClass framsClass) {
11
12                AccessInterface framsClassAccess = new ReflectionAccess(FramsClass.class);
13                AccessInterface paramAccess = new ReflectionAccess(Param.class);
14                framsClassAccess.select(framsClass);
15                framsClassAccess.save(sink);
16                for (Param p : framsClass.getParamEntries()) {
17                        paramAccess.select(p);
18                        paramAccess.save(sink);
19                }
20        }
21
22}
Note: See TracBrowser for help on using the repository browser.