/** * Creates a class metatdata * * @param uri The uri that identifies this type * @param type The type to create the metadata for * @param factory A reflection library to provide class construction and field get/set functionality * @param copyStrategyLibrary A copy strategy library * @throws NoSuchMethodException If the class has no default constructor */ public ClassMetadata(SimpleUri uri, Class<T> type, ReflectFactory factory, CopyStrategyLibrary copyStrategyLibrary, Predicate<Field> includedFieldPredicate) throws NoSuchMethodException { if (System.getSecurityManager() != null) { System.getSecurityManager().checkPermission(CREATE_CLASS_METADATA); } this.uri = uri; this.clazz = type; if (!type.isInterface() && !Modifier.isAbstract(type.getModifiers())) { this.constructor = factory.createConstructor(type); } else { this.constructor = null; } addFields(copyStrategyLibrary, factory, includedFieldPredicate); }