reflection_factory 2.0.4
reflection_factory: ^2.0.4 copied to clipboard
Allows Dart reflection with an easy approach, even for third-party classes, using code generation portable for all Dart platforms.
2.0.4 #
JsonEncoder:- Added
JsonEncoder.callToJson:- Optimized call of
toJsonand avoidNoSuchMethodError.
- Optimized call of
- Added
TypeInfo- Added static
isPrimitiveTypeFor
- Added static
TypeParser:- Optimize
isPrimitiveTypeandisPrimitiveValue.
- Optimize
ClassReflection:- Optimize
withObject.
- Optimize
FieldReflection:- Optimize
withObject.
- Optimize
ReflectionBuilder:- Optimize generation of getters that can use static fields:
- Enums:
fieldsNames,valuesByName
- Classes:
constructorsNames,fieldsNames,staticFieldsNames,methodsNames,staticMethodsNames.
- Enums:
- Fix: ensure that reflected annotations are
const.
- Optimize generation of getters that can use static fields:
analysis_options.yaml:- Added linter rules:
avoid_dynamic_callsavoid_type_to_stringno_runtimeType_toStringdiscarded_futuresno_adjacent_strings_in_list
- Added linter rules:
2.0.3 #
JsonEntityCacheSimple:- Rename
lengthtototalCachedEntitesto avoid implementation issues.
- Rename
2.0.2 #
ClassReflection:getBestConstructorsFor,createInstanceWithBestConstructor,getBestConstructorForMap,getBestConstructorsForMap:- Added parameter
allowOptionalOnlyConstructors.
- Added parameter
createInstanceFromMap:- Improved constructor resolution.
EnableReflection,ReflectionBridge:- Added parameter
optimizeReflectionInstances = true:- If
trueall generatedClassReflectionandEnumReflectionwill have afactoryconstructor and anExpandoto cache reflection instances.
- If
- Added parameter
FunctionReflection:methodInvocationFromMap: optimize and clean code.
- Added annotation
JsonConstructor.
2.0.1 #
ClassReflection.createInstanceWithBestConstructor:- Now throws
UnresolvedParameterErrorinstead ofStateErrorfor unresolved parameters.
- Now throws
- analyzer: ^5.5.0
- test: ^1.23.1
- coverage: ^1.6.3
2.0.0 #
ClassReflection:constructor:- removed
<R>type.
- removed
field:- Ggenerated implementation declares
TofFieldReflection<$class,T>statically.
- Ggenerated implementation declares
- Optimized:
allFields,allMethods: object instances derived from cachedno-objectinstances.construtor,staticField,field,method:- Caching instances.
- Object instances derived from cached
no-objectinstances.
FieldReflection:- Added
setNullable.
- Added
- benchmark: ^0.3.0
benchmark/reflection_factory_benchmark.dart
- meta: ^1.9.0
1.2.25 #
- Extra fix: issue when a source has a
part ofdirective.
1.2.24 #
- Fix issue when a source has a
part ofdirective.
1.2.23 #
ReflectionBuilder- New
sequentialandbuildStepTimeout. - Build now is sequential by default:
- Only one
BuildStepis processed at a time. - Avoid
InconsistentAnalysisException(buildissue #2689).
- Only one
- New
- Added
build.yamloptions (verbose,sequential,timeout). - Improved logging.
- Added
ClassProxytest usinglibraryPath. reflection_factory/build.yaml:generate_for:- Added
bin/*
- Added
1.2.22 #
- Attempt to avoid
buildissue:InconsistentAnalysisException: Requested result might be inconsistent with previously returned results#2689- https://github.com/dart-lang/build/issues/2689
- mime: ^1.0.4
- build_test: ^2.1.6
- test: ^1.22.2
- coverage: ^1.6.2
1.2.21 #
ClassReflection:- Fix generated
supperTypes.
- Fix generated
1.2.20 #
- Migrate to
analyzer: ^5.4.0. - analyzer: ^5.4.0
1.2.19 #
TypeInfo:- Added
isPrimitiveOrDynamicOrObjectTypeandisEntityType.
- Added
- Fix
castMapTypeforMap<String,dynamic>.
1.2.18 #
Reflection:- Fix
castMap: - Added
castMapKeysandcastMapValues. - Added getters:
asTypeReflection,typeInfo,listType,mapKeyTypeandmapValueType.
- Fix
JsonCodec:- Added field
mapCaster.
- Added field
_JsonDecoder:- Now supports
Mapcasting when decoding an entity field.
- Now supports
- Added
castMapType. ReflectionBuilder:- Optimize and reduce generated code.
- build: ^2.3.1
- analyzer: ^4.7.0
- dart_style: ^2.2.4
- mime: ^1.0.3
- pub_semver: ^2.1.3
- path: ^1.8.3
- build_runner: ^2.3.3
- lints: ^2.0.1
- test: ^1.22.1
- coverage: ^1.6.1
1.2.17 #
FunctionReflection.parametersNamesWhere:- Added parameter
nameResolver.
- Added parameter
ClassReflection.getBestConstructorsFor:- Improve parameter/field JSON name alias (
JsonFieldAlias) resolution.
- Improve parameter/field JSON name alias (
1.2.16 #
ClassReflection:- Added
fieldsWithJsonFieldHidden,fieldsWithJsonFieldVisible,hasJsonFieldHiddenandhasJsonFieldVisible. - Added
entityFieldsandentityFieldsNamesWhere. - Added
getBestConstructorsFor. getBestConstructorFor: using multiple contructor candidates.
- Added
1.2.15 #
JsonTypeDecoder: added parameterTypeInfo typeInfo.JsonDecoder:- Added
unregisterTypeDecoder - Allow decoding of
nullvalues with personalizedJsonTypeDecoder.
- Added
- Added
ClassReflection.createInstanceWithConstructorByName.
1.2.14 #
FunctionReflection.methodInvocation:- Function
parameterProvider:- Add
parameterIndexto indicate the order of the parameter in the method.
- Add
- Function
1.2.13 #
- Json:
- Add parameter
TypeInfoas an alternative to the parameterType. - Improve collections casting.
- Add parameter
TypeInfo:- Added constructors:
TypeInfo.fromListType,TypeInfo.fromSetType,TypeInfo.fromMapType. - Added
toListType,toSetType,toIterableType,toMapValueTypeandtoMapKeyType. - Added
castList,castSet,castIterableandcastMap.
- Added constructors:
1.2.12 #
ClassReflectionadded fieldclassName.EnumReflectionadded fieldenumName.
1.2.11 #
ClassProxy:- Optimize
@ClassProxyclasses resolution speed. - Added
ClassProxytest withlibraryPathparameter.
- Optimize
README.md:- Added
partdirective description. - Added
@ClassProxyexample.
- Added
- Added tests for
JsonEntityCacheSimple.
1.2.10 #
- Small fix in
TypeInfo.toString: was not passing the parameterwithTto recursive calls.
1.2.9 #
ReflectionFactory:- Added
getRegisterClassReflectionByNameandgetRegisterEnumReflectionByName.
- Added
JsonTypeDecoder: added parameterjsonDecoder.
1.2.8 #
FunctionReflection.methodInvocationFromMapandFunctionReflection.methodInvocation:- Better handling of unresolved parameters values. Attempts to resolve 2 times, to allow entities references through cache.
Reflection:castList,castSet,castIterable,castMap,castCollection:- Added parameter
nullable.
- Added parameter
1.2.7 #
TypeInfo:- Added
Tgeneric type. - Added
callCastedto pass theTto aFunction<T>(). - Improved internal representation og
arguments.
- Added
ReflectionBuilder:- Declare reflected types using
TypeInfo<T>generics.
- Declare reflected types using
- Improved tests coverage.
1.2.6 #
- Add
coverage:ignore-fileto generated files. - analyzer: ^4.6.0
1.2.5 #
Json:toJson: fix casting bug when the resulting JSON value isnull.
- Removed unused analyzer helper code.
- Adjusted for analyzer 4.4.0.
- sdk: '>=2.17.0 <3.0.0'
- analyzer: ^4.4.0
1.2.4 #
TypeParserandTypeInfo:- Add support for
Uint8List.
- Add support for
1.2.3 #
JsonEntityCache:- Added instance
id. - Added
allowEntityFetch.
- Added instance
TypeInfo:- Added
equalsTypeAndArguments.
- Added
TypeReflection:- Added
isBigInt. isNumericTyperenamed toisNumberType.- Added
isNumericType(isNumericType+isBigInt).
- Added
- Added extension
TypeExtension:- method
isPrimitiveType.
- method
- Added extension
GenericObjectExtension:isPrimitiveValue,isPrimitiveList,isPrimitiveMap.
1.2.2 #
ReflectionInspector:- Fix inspection for generated files in the subdirectory
reflection.
- Fix inspection for generated files in the subdirectory
1.2.1 #
- Fix use of deprecated methods of package
analyzer. - build: ^2.3.0
- analyzer: ^4.3.0
- pub_semver: ^2.1.1
- yaml: ^3.1.1
- source_span: ^1.9.1
- build_runner: ^2.2.0
- build_test: ^2.1.5
- pubspec: ^2.3.0
- data_serializer: ^1.0.7
- dependency_validator: ^3.2.2
- test: ^1.21.4
- coverage: ^1.5.0
1.2.0 #
- sdk: '>=2.15.0 <3.0.0'
- analyzer: ^4.1.0
- meta: ^1.8.0
- path: ^1.8.2
- build_runner: ^2.1.11
- lints: ^2.0.0
- pubspec: ^2.2.0
- test: ^1.21.2
- coverage: ^1.3.2
1.1.2 #
ClassProxy.- Allow type parameters in generated proxy methods.
1.1.1 #
TypeInfo:- Fix
fromJsonwhen decoding a list with a graph containing duplicated entities (referenced by ID). - Added support for
FutureOr.
- Fix
JsonCoder/JsonEncoder/JsonDecoder:- Allow override of
autoResetEntityCachewhile encoding or decoding.
- Allow override of
- Improved GitHub CI: added browser tests (chrome).
- mime: ^1.0.2
- analyzer: ^3.4.1
- dart_style: ^2.2.3
1.1.0 #
- Changed possible generated reflection file path. Now it can generate:
- Inside the directory:
reflection/{{file}}.g.dart - Or as a sibling file
{{file}}.reflection.g.dart
- Inside the directory:
- Added warning of absent
partdirective for the generated reflection file.
1.0.29 #
ClassReflection:- Add parameter
duplicatedEntitiesAsIDto JSON related methods.
- Add parameter
1.0.28 #
- Fix
createInstanceFromMapwhen there's no constructor without arguments. - New annotation
JsonFieldAlias.
1.0.27 #
- Fix JSON
DateTimeparsing when encoded as anint. - JSON encoder/decoder can reference already encoded entities by ID through
JsonEntityCache.
1.0.26 #
- Fix
ClassProxy.ignoreParametersTypes.
1.0.25 #
ClassProxy: addedignoreParametersTypes.
1.0.24 #
ClassProxy:- Fix proxy generation for methods that returns
FutureOr.
- Fix proxy generation for methods that returns
ClassReflection:- Optimize
createInstanceWithBestConstructorandgetBestConstructorForMap.
- Optimize
- source_span: ^1.8.2
- path: ^1.8.1
- collection: ^1.16.0
- build: ^2.2.1
- analyzer: ^3.3.1
- dart_style: ^2.2.1
1.0.23 #
ClassProxy:- Fix target class resolution issue. Added
libraryPath. - Added extra configuration:
alwaysReturnFuture,traverseReturnTypes,ignoreMethods.
- Fix target class resolution issue. Added
- Improve
JsonEncoderandJsonDecoder:- Added
registerTypeToEncodableandregisterTypeDecoder.
- Added
1.0.22 #
- Added
ClassProxy:- Allows generation of a class proxy without directly depending on the target class.
1.0.21 #
- Improve JSON codec customization.
- Improve
createInstanceWithBestConstructor.
1.0.20 #
- Added
TypeInfoto perform type checking and handle otherTypeoperations needed for reflection use. - Improved
TypeReflectionforFunctiontypes. - Fixed constructors with nullable named parameters.
- Fixed constructors with
requirednamed parameters. - Fixed fields/parameters with
Functiontypedefalias.
1.0.19 #
- Fix small bug at
createInstanceFromMapfor field resolution.
1.0.18 #
EnumReflection: addedenumNameto extension.- Fix
siblingEnumReflectionForandsiblingEnumReflectionFor.
1.0.17 #
- JSON
- Better JSON handling and reflection integration.
- Encoding/decoding to/from bytes (
Uint8List). @JsonField: to hide a field or to force it as a json field.
- Added support for enums:
EnumReflection ClassReflection:- Support for supper classes.
- Added
createInstanceWithNoRequiredArgsConstructoras another way to create an instance without arguments. - Added
getBestConstructorFor, that selects the constructor capable to create an instance with provided parameters. - Added
fromJsonandfromJsonEncoded. - Added
createInstanceWithBestConstructorandcreateInstanceFromMap. - Added
declaringType.
- Generating
ClassFoo$fromJsonandClassFoo$fromJsonEncoded. - Optimized some operations.
- Fixed
TypeReflectionforFunction. - mime: ^1.0.1
- base_codecs: ^1.0.1
1.0.16 #
ClassReflection:withoutObjectInstance: now always returns the same instance.- Added
reflectionFactoryVersion.
1.0.15 #
ClassReflection: addedcallCasted.ReflectionInspector: now checks if a generated file version is the same of thereflection_factorypackage.
1.0.14 #
ClassReflection:- Added
siblingsClassReflectionandwithoutObjectInstance. registernow triggers registration of all siblingClassReflection.
- Added
- Using standard Dart coverage.
- coverage: ^1.0.3
1.0.13 #
- Allow call to
fieldwithout an object. Useful to get the field type before instantiate an object.
1.0.12 #
FieldReflection: addedhasSetter.
1.0.11 #
- Added support to default values of optional and named parameters.
1.0.10 #
- Removed
BUILD TIMEcomment in generated files to avoid unnecessary generate file modification/change.
1.0.9 #
- Added
ReflectionInspector. - Generated files now have the package version in the header comments.
toJsonEncodable: fixed handling ofDateTime.- Improved tests.
1.0.8 #
- Improve tests.
- Fix issue with genetic types.
1.0.7 #
TypeReflection:- Added
isOfType.
- Added
FunctionReflection(MethodReflection,ConstructorReflection):methodInvocation(parametersProvider)now accepts aParameterReflection, not only aStringwith the parameter name.
1.0.6 #
ClassReflection:- Added:
fieldsWhere,staticFieldsWhere,methodsWhere,staticMethodsWhere.
- Added:
TypeReflection:- Added:
isPrimitiveType,isCollectionType,isMapType,isIterableType,isNumericType,isIntType,isDoubleType,isBoolType,isStringType.
1.0.5 #
- Added support for class constructors.
- Added
TypeReflection:- Allows handling of Type generics/arguments.
- Added extensions:
IterableTypeReflectionExtension,IterableParameterReflectionExtension,IterableFieldReflectionExtension.
1.0.4 #
- Added
ElementResolver: ClassReflection:- Added resolvers:
fieldResolver,staticFieldResolver,methodResolver,staticMethodResolver. - Optimized
toJsonto resolve fasterMethodReflectionofobj.toJson.
- Added resolvers:
- Changed
FieldReflectionto allowwithObject. - Changed
MethodReflectionto allowwithObject. - Added
ReflectionFactory.toJsonEncodable. - Improve API Documentation.
- Fix issue with operator overloading.
1.0.3 #
- Annotation reflection:
- Support for classes, fields, methods and method parameters.
1.0.2 #
ClassReflection:- Added:
allMethods,allStaticMethods
- Added:
MethodReflection:- Methods parameters now are defined with
ParameterReflection. returnType: fixed forvoid.method: exposed, not private anymore.- Added:
equalsNormalParametersTypes,equalsOptionalParametersTypes,equalsNamedParametersTypes.methodInvocation,methodInvocationFromMap.
- Methods parameters now are defined with
MethodInvocation: class to represent an invocation.- Builder:
- Now generates documentation of generated extension methods.
- Better handling of parameters and fields with
ParameterReflection.- Now knows if a parameter is
required.
- Now knows if a parameter is
- Improved API documentation.
- Improved tests.
- collection: ^1.15.0
1.0.1 #
- @EnableReflection:
- Added
reflectionClassName,reflectionExtensionName.
- Added
- @ReflectionBridge:
- Added
bridgeExtensionName,reflectionClassNames,reflectionExtensionNames.
- Added
- Builder:
MethodReflection:- Added method parameters names to normal and optional parameters.
- Optimize generated code.
- Improved console output and verbose mode.
- Improved tests.
1.0.0 #
- Support for Class reflection:
- FieldReflection
- MethodReflection
- Initial version.