Ejemplo n.º 1
0
 public ConstructorInfo ResolveCtor(Type clazz, Type[] paramTypes)
 {
     try {
         return(MethodResolver.ResolveCtor(clazz, paramTypes));
     } catch (EngineNoSuchCtorException e) {
         throw Convert(clazz, paramTypes, e);
     }
 }
Ejemplo n.º 2
0
        public override DataInputOutputSerdeForge ToForge()
        {
            var field = SerdeClass.GetField("INSTANCE");
            if (field != null) {
                return new DataInputOutputSerdeForgeSingleton(SerdeClass);
            }

            try {
                MethodResolver.ResolveCtor(SerdeClass, new Type[0]);
                return new DataInputOutputSerdeForgeEmptyCtor(SerdeClass);
            }
            catch (MethodResolverNoSuchCtorException) {
            }

            throw new EPException("Serde class '" + SerdeClass.Name + "' does not have a singleton-style INSTANCE field or default constructor");
        }