public Type CompileStandInClass( CodegenClassType classType, string classNameSimple, ModuleCompileTimeServices services) { var namespaceScope = new CodegenNamespaceScope(services.Namespace, null, false); var classScope = new CodegenClassScope(true, namespaceScope, null); var clazz = new CodegenClass( classType, null, classNameSimple, classScope, EmptyList<CodegenTypedParam>.Instance, null, new CodegenClassMethods(), new CodegenClassProperties(), EmptyList<CodegenInnerClass>.Instance); // This is a bit hacky... basically, Esper has to generate a "Type" that can be returned and // included as the "Underlying" type for the JsonEventType. This method is called during the // portion of the sequence where we are attempting to build the forgeables, so the real type // doesnt exist yet. Esper builds the stand-in but expects that the real type will be used // at runtime. In Java, type erasure allows this to happen because there is no real type in // backing arrays and collections. In .NET we need the types to match. // // We are creating a "capsule" class which will act as a placeholder. When we detect that // the type is a capsule type in the JsonEventType, we will attempt to "resolve" and replace // it. var classNameFull = namespaceScope.Namespace + '.' + classNameSimple; var capsuleClass = CapsuleEmitter.CreateCapsule(classNameFull); return capsuleClass.TargetType; }
public StmtClassForgeableJsonDeserializer( CodegenClassType classType, string className, CodegenNamespaceScope namespaceScope, string underlyingClassName, StmtClassForgeableJsonDesc desc) { _classType = classType; _className = className; _namespaceScope = namespaceScope; _underlyingClassName = underlyingClassName; _desc = desc; }
public CodegenClass( CodegenClassType classType, Type optionalInterfaceImplemented, string className, CodegenClassScope codegenClassScope, IList<CodegenTypedParam> explicitMembers, CodegenCtor optionalCtor, CodegenClassMethods methods, CodegenClassProperties properties, IList<CodegenInnerClass> innerClasses) : this(classType, className, codegenClassScope, explicitMembers, optionalCtor, methods, properties, innerClasses) { BaseList.AssignType(optionalInterfaceImplemented); }
public StmtClassForgeableJsonSerializer( CodegenClassType classType, string className, bool makeWriteMethod, CodegenNamespaceScope namespaceScope, string underlyingClassName, StmtClassForgeableJsonDesc desc) { _classType = classType; _className = className; _makeWriteMethod = makeWriteMethod; _namespaceScope = namespaceScope; _underlyingClassName = underlyingClassName; _desc = desc; }
public static int GetSortCode(this CodegenClassType value) { switch (value) { case CodegenClassType.APPDECLARED: return(5); case CodegenClassType.KEYPROVISIONING: return(10); case CodegenClassType.KEYPROVISIONINGSERDE: return(20); case CodegenClassType.STATEMENTFIELDS: return(30); case CodegenClassType.JSONNESTEDCLASSDELEGATEANDFACTORY: return(40); case CodegenClassType.JSONEVENT: return(41); case CodegenClassType.JSONDELEGATE: return(42); case CodegenClassType.JSONDESERIALIZER: return(43); case CodegenClassType.JSONSERIALIZER: return(44); case CodegenClassType.EVENTSERDE: return(50); case CodegenClassType.RESULTSETPROCESSORFACTORYPROVIDER: return(60); case CodegenClassType.OUTPUTPROCESSVIEWFACTORYPROVIDER: return(70); case CodegenClassType.STATEMENTAIFACTORYPROVIDER: return(80); case CodegenClassType.STATEMENTPROVIDER: return(90); case CodegenClassType.FAFQUERYMETHODPROVIDER: return(100); case CodegenClassType.FAFPROVIDER: return(110); case CodegenClassType.MODULEPROVIDER: return(120); default: throw new ArgumentOutOfRangeException(nameof(value)); } }
public CodegenClass( CodegenClassType classType, string className, CodegenClassScope codegenClassScope, IList<CodegenTypedParam> explicitMembers, CodegenCtor optionalCtor, CodegenClassMethods methods, CodegenClassProperties properties, IList<CodegenInnerClass> innerClasses) { BaseList = new CodegenClassBaseList(); ClassType = classType; Namespace = codegenClassScope.NamespaceScope.Namespace; ClassName = className; OptionalCtor = optionalCtor; ExplicitMembers = explicitMembers; Methods = methods; Properties = properties; IList<CodegenInnerClass> allInnerClasses = new List<CodegenInnerClass>(innerClasses); allInnerClasses.AddAll(codegenClassScope.AdditionalInnerClasses); InnerClasses = allInnerClasses; }