Releases: miho/VMF
v0.2.6.3: Fixed effectively-immutable test...
...which determines the only valid case where the read-only interface is allowed to implement the modifiable interface the problem was that delegation methods where not taken into account. they are not allowed in read-only and immutable cases because they are likely breaking the immutability contract
v0.2.6.2: this release contains several fixes:
- overriding getter-only properties works even if the overriding property is a model-type and the super-types property is an external type, e.g., Object - type resolution and utility methods improved - property-order bugs fixed
v0.2.6.1
Model Documentation Support
Models can be documented via the newly introduced @Doc("The documentation")
. This documentation will be added to the generated API documentation, see issue #27 .
Example:
@Doc("A finite state machine.")
interface FSM {
@Doc("The current state of this FSM.")
State getCurrentState();
...
}
Fixed custom toString()
v0.2.5 next ver
Cross References
Cross references are finally fully supported via @Refers
. Example:
package eu.mihosoft.vmftest.complex.account.vmfmodel;
import eu.mihosoft.vmf.core.Container;
import eu.mihosoft.vmf.core.Contains;
import eu.mihosoft.vmf.core.InterfaceOnly;
import eu.mihosoft.vmf.core.Refers;
interface AccountModel {
@Contains(opposite="model")
Customer[] getCustomers();
@Contains(opposite="model")
Account[] getAccounts();
}
interface Account {
String getName();
@Refers(opposite="accounts")
Customer[] getAuthorizedSignatories();
@Container(opposite="accounts")
AccountModel getModel();
}
@InterfaceOnly
interface Customer {
@Refers(opposite="authorizedSignatories")
Account[] getAccounts();
@Container(opposite="customers")
AccountModel getModel();
}
interface PrivateCustomer extends Customer {
String getFirstName();
String getLastName();
Address getResidentialAddress();
}
interface BusinessCustomer extends Customer {
String getCompanyName();
Address getCompanyAddress();
}
interface Address {
String getStreet();
String getCity();
String getPostal();
}
Improved Safety for ImmutableTypes
Several Bugs fixed, Improved Immutability & InterfaceOnly
- So far, it was difficult to declare common super-types for immutable and mutable types. This is now possible:
package mypkg.vmfmodel;
import eu.mihosoft.vmf.core.*;
@InterfaceOnly
interface WithName {
@GetterOnly
String getName();
}
interface ImmutableObj extends WithName { }
interface MutableObj extends WithName { }
Fixed issue #12 (immutable types)
v0.2.0.1 prepare new version
Annotations, Reflection Improvements and new Gradle plugin
Annotations:
Models can now be annotated, e.g.,
@Annotation(key = "key 1", value = "my value")
interface AnnotatedModel {
@Annotation(key="prop key 1", value = "my prop value")
String getName();
}
This makes querying specific objects or properties much easier.
Reflection:
Reflection works now directly on a type, e.g.:
Reflection r = MyParent.type().reflect()
Additionally, properties can be observed via the reflection API:
prop.addChangeListener(change ->
// react to changes
);
Gradle Plugin:
The gradle plugin registers vmf
properly now, just like java
and resources
are registered. Each source set can use its own dependencies for model generation.
Support for IntelliJ IDEA and VS Code has been improved (vmf folder is recognized as source root). The property
ext.vmfPluginIntelliJIntegration = true
enables the additional support (vmf folders are added ass source root and generated src dirs are marked as being generated, i.e., intellij will warn whenever a change is made to the generated file).