diff --git a/typescript/README.md b/typescript/README.md new file mode 100644 index 000000000..d8bb160de --- /dev/null +++ b/typescript/README.md @@ -0,0 +1,21 @@ +Because of the lack of a usable UML editor for Typescript I've used IntelliJ's Java-Uml. Typescript .d.ts are close to Java classes, so the diagram helps me to get the big picture. +I investigated mainly the classes in org/hisrc/jsonix/Jsonix/Model to draw it. + +This typescript definitions are the first draft and the work is in progress. It's a base to discuss about. +The aims of this branch are: + +Defining the public interfaces from the Context (marshaller, unmarshaller) +Defining the internal data types (TypeInfo, PropertyInfo, Mapping) + +... a fully migration to TS? + +I started with the data types because I need them for my current project + +There are still no tests, my suggestion is to use existing ones (and migrating later carefully to TS) but first we have to clear the working process. +E.g. +- Jsonix (sometimes) uses prototype (multiple) inheritance and there is a discussion how to handle this in TS +- how to implement generics (witch would be very usefull) +like createUnmarshaller(type: T): Unmarshaller (doesn't work without changing th jsonix code) + + + diff --git a/typescript/src/main/java/org/hisrc/jsonix/Binding/Mashalls/Element.java b/typescript/src/main/java/org/hisrc/jsonix/Binding/Mashalls/Element.java index fca73705b..c2516c755 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Binding/Mashalls/Element.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Binding/Mashalls/Element.java @@ -3,4 +3,5 @@ public interface Element { Object elementInfo = null; + String CLASS_NAME = ""; } diff --git a/typescript/src/main/java/org/hisrc/jsonix/Binding/Unmashalls/Element.java b/typescript/src/main/java/org/hisrc/jsonix/Binding/Unmashalls/Element.java index 3ac36298c..63ed1a704 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Binding/Unmashalls/Element.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Binding/Unmashalls/Element.java @@ -3,4 +3,5 @@ public interface Element { Object elementInfo = null; + String CLASS_NAME = ""; } diff --git a/typescript/src/main/java/org/hisrc/jsonix/Mapping/Styled.java b/typescript/src/main/java/org/hisrc/jsonix/Mapping/Styled.java index d885ddbb5..e363ee7e7 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Mapping/Styled.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Mapping/Styled.java @@ -3,4 +3,5 @@ public interface Styled { Object mappingSyle = null; + String CLASS_NAME = ""; } diff --git a/typescript/src/main/java/org/hisrc/jsonix/Model/PropertyInfo.java b/typescript/src/main/java/org/hisrc/jsonix/Model/PropertyInfo.java index ac56b02a8..5bfb6ba95 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Model/PropertyInfo.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Model/PropertyInfo.java @@ -1,6 +1,7 @@ package org.hisrc.jsonix.Model; public class PropertyInfo { + String CLASS_NAME; Object name = null; boolean collection = false; String targetNamespace = ""; diff --git a/typescript/src/main/java/org/hisrc/jsonix/Model/TypeInfo.java b/typescript/src/main/java/org/hisrc/jsonix/Model/TypeInfo.java index 145d883af..e06c9354d 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Model/TypeInfo.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Model/TypeInfo.java @@ -1,6 +1,7 @@ package org.hisrc.jsonix.Model; -public class TypeInfo { +public class TypeInfo{ + String CLASS_NAME; String name = ""; TypeInfo baseTypeInfo = null; } diff --git a/typescript/src/main/java/org/hisrc/jsonix/Schema/XML/QName.java b/typescript/src/main/java/org/hisrc/jsonix/Schema/XML/QName.java index 91d6a0b35..b65504971 100644 --- a/typescript/src/main/java/org/hisrc/jsonix/Schema/XML/QName.java +++ b/typescript/src/main/java/org/hisrc/jsonix/Schema/XML/QName.java @@ -7,5 +7,6 @@ public class QName String localPart = null; String prefix = null; String string = null; + String CLASS_NAME = ""; } diff --git a/typescript/src/main/resources/diagram.svg b/typescript/src/main/resources/diagram.svg index c06668908..ada83cec3 100644 --- a/typescript/src/main/resources/diagram.svg +++ b/typescript/src/main/resources/diagram.svg @@ -1,4 +1,4 @@ - + @@ -96,28 +96,28 @@ - + - + - + - + - + - + - + - + @@ -132,7 +132,7 @@ - + @@ -141,7 +141,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -174,2411 +174,2636 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + ValuePropertyInfo - + ValuePropertyInfo - + - + - + - + - + - + - + TypeInfo - + typeInfo - + - + QName - + elementName - + - + - + - + ElementPropertyInfo - + ElementPropertyInfo - + - + - + - + - + Object - - - - - elementTypeInfos + + + + + elementTypeInfos - + - + Object - - - - - elementTypeInfosMap - - - - - - - + + + + + elementTypeInfosMap - - + + - - ElementsPropertyInfo + + + - - ElementsPropertyInfo + + - - + + ElementsPropertyInfo - - + + ElementsPropertyInfo - - + + - - + + - - Object - - - - - - name + + - - + + - - Object + + Object - + - - typeInfos + + name - - + + - - Object + + Object - + - - elementInfos + + typeInfos - - + + - - String + + Object - - - - - targetNamespace + + + + + elementInfos - - + + - - String + + String - + - - defaultElementNamespaceURI + + targetNamespace - - + + - - String + + String - + - - defaultAttributeNamespaceURI + + defaultElementNamespaceURI - - + + - - - + + String - - + + + + + defaultAttributeNamespaceURI - - Module + + - - Module + + + - - + + - - + + Module - - + + Module - - + + - - + + - - + + - - Object + + - - - - - name + + - - + + - - boolean + + String - + - - collection + + CLASS_NAME - - + + - - String + + Object - + - - targetNamespace + + name - - + + - - String + + boolean - + - - defaultElementNamespaceURI + + collection - - + + - - String + + String - + - - defaultAttributeNamespaceURI + + targetNamespace - - + + - - boolean + + String - + - - built + + defaultElementNamespaceURI - - + + - - - + + String - - + + + + + defaultAttributeNamespaceURI - - PropertyInfo + + - - PropertyInfo + + boolean - - + + + + + built - - + + - - + + + - - + + - - String + + PropertyInfo - - - - - typeInfo + + PropertyInfo - - + + - - Object + + - - - - - elementName + + - - + + - - - + + String - - + + + + + typeInfo - - ElementRefPropertyInfo + + - - ElementRefPropertyInfo + + Object - - + + + + + elementName - - + + - - + + + - - + + - - + + ElementRefPropertyInfo - - + + ElementRefPropertyInfo - - Object + + - - - - - name + + - - + + - - Object + + - - - - - baseTypeInfo + + String - - + + + + + key - - Object + + - - - - - entries + + String - - + + + + + namespaceURI - - Object + + - - - - - keys + + String - - + + + + + localPart - - Object + + - - - - - values + + String - - + + + + + prefix - - boolean + + - - - - - built + + String - - + + + + + string - - - + + - - + + String - - EnumLeafInfo + + + + + CLASS_NAME - - EnumLeafInfo + + - - + + + - - + + - - + + QName - - + + QName - - Object + + - - - - - elementTypeInfos + + - - + + - - Object + + + + + + + + - - - - - elementTypeInfosMap + + Object - - + + + + + name - - - + + - - + + Object - - ElementRefsPropertyInfo + + + + + baseTypeInfo - - ElementRefsPropertyInfo + + - - + + Object - - + + + + + entries - - + + - - + + Object - - - + + + + + keys - - + + - - AnyAttributePropertyInfo + + Object - - AnyAttributePropertyInfo + + + + + values - - + + - - + + boolean - - + + + + + built - - + + - - String + + + - - - - - name + + - - + + EnumLeafInfo - - String + + EnumLeafInfo - - - - - localName + + - - + + - - QName + + - - - - - typeName + + - - + + Object - - Object + + + + + elementTypeInfos - - - - - instanceFactory + + - - + + Object - - ElementPropertyInfo[] + + + + + elementTypeInfosMap - - - - - properties + + - - + + + - - HashMap<String, ElementPropertyInfo> + + - - - - - propertiesMap + + ElementRefsPropertyInfo - - + + ElementRefsPropertyInfo - - Structure + + - - - - - structure + + - - + + - - String + + - - - - - targetNamespace + + + - - + + - - String + + AnyAttributePropertyInfo - - - - - defaultElementNamespaceURI + + AnyAttributePropertyInfo + + + + + + + + + - - + + - - String + + String - - - - - defaultAttributeNamespaceURI + + + + + name - - + + - - boolean + + String - - - - - built + + + + + localName - - + + - + + QName + + + + + + typeName + + + + + Object - - - - - propertyInfoCreators + + + + + instanceFactory - - + + - - - + + ElementPropertyInfo[] - - + + + + + properties - - ClassInfo + + - - ClassInfo + + HashMap<String, ElementPropertyInfo> - - + + + + + propertiesMap - - + + - - + + Structure - - + + + + + structure - - Object + + - - - - - elementName + + String - - + + + + + targetNamespace - + + + + + String + + + + + + defaultElementNamespaceURI + + + + + + String + + + + + + defaultAttributeNamespaceURI + + + + + + boolean + + + + + + built + + + + + Object - - - - - key + + + + + propertyInfoCreators + + + + + + + - - + + - + + ClassInfo + + + ClassInfo + + + + + + + + + + + + + + Object - - - - - value + + + + + elementName - - + + - + Object - - - - - entryTypeInfo + + + + + key - - + + - - - + + Object - - + + + + + value - - ElementMapPropertyInfo + + - - ElementMapPropertyInfo + + Object - - + + + + + entryTypeInfo - - + + - - + + + - - + + - - QName + + ElementMapPropertyInfo - - - - - wrapperElementName + + ElementMapPropertyInfo - - + + - - boolean + + - - - - - allowDom + + - - + + - - boolean + + Object - - - - - allowTypedObject + + + + + + + elementInfo - - + + - - boolean + + String - - - - - mixed + + + + + + + CLASS_NAME - - + + - - - + + + - - + + - - AbstractElementsPropertyInfo + + Element - - AbstractElementsPropertyInfo + + Element - - + + - - + + - - + + - - + + - - + + - - + + - - String + + QName - - - - - typeInfo + + + + + wrapperElementName - - + + - - - + + boolean - - + + + + + allowDom - - SingleTypePropertyInfo + + - - SingleTypePropertyInfo + + boolean - - + + + + + allowTypedObject - - + + - - + + boolean - - + + + + + mixed - - Object + + - - - - - wrapperElementName + + + - - + + - - boolean + + AbstractElementsPropertyInfo - - - - - allowDom + + AbstractElementsPropertyInfo - - + + - - boolean + + - - - - - allowTypedObject + + - - + + - - boolean + + - - - - - mixed + + - - + + String - - - + + + + + typeInfo - - + + - - AbstractElementRefsPropertyInfo + + + - - AbstractElementRefsPropertyInfo + + - - + + SingleTypePropertyInfo - - + + SingleTypePropertyInfo - - + + - - + + - - boolean + + - - - - - allowDom + + - - + + - - boolean + + - - - - - allowTypedObject + + Object - - + + + + + wrapperElementName - - boolean + + - - - - - mixed + + boolean - - + + + + + allowDom - - - + + - - + + boolean - - AnyElementPropertyInfo + + + + + allowTypedObject - - AnyElementPropertyInfo + + - - + + boolean - - + + + + + mixed - - + + - - + + + - - + + - - + + AbstractElementRefsPropertyInfo - - String + + AbstractElementRefsPropertyInfo - - - - - name + + - - + + - - TypeInfo + + - - - - - baseTypeInfo + + - - + + Object - - - + + + + + + + mappingSyle - - + + - - TypeInfo + + String - - TypeInfo + + + + + + + CLASS_NAME - - + + - - + + + - - + + - - + + Styled - - Object + + Styled - - - - - elementName + + - - + + - - Object + + - - - - - typeInfo + + - - + + - - Object + + - - - - - substitutionHead + + boolean - - + + + + + allowDom - - Object + + - - - - - scope + + boolean - - + + + + + allowTypedObject - - boolean + + - - - - - built + + boolean - - + + + + + mixed - - - + + - - + + + - - ElementInfo + + - - ElementInfo + + AnyElementPropertyInfo - - + + AnyElementPropertyInfo - - + + - - + + - - + + - - HashMap<String, ElementPropertyInfo> + + - - - - - elements + + - - + + - - Object + + String - - - - - attributes + + + + + CLASS_NAME - - + + - - Object + + String - - - - - anyAttribute + + + + + name - - + + - - Object + + TypeInfo - - - - - value + + + + + baseTypeInfo - - + + - - Object + + + - - - - - any + + - - + + TypeInfo - - - + + TypeInfo - - + + - - Structure + + - - Structure + + - - + + - - + + Object - - + + + + + elementName - - + + - + Object - - - - - attributeName + + + + + typeInfo - - + + - - - + + Object - - + + + + + substitutionHead - - AttributePropertyInfo + + - - AttributePropertyInfo + + Object - - + + + + + scope - - + + - - + + boolean - - + + + + + built - - Object + + - - - - - - - mappingSyle + + + - - + + - - - + + ElementInfo - - + + ElementInfo - - Styled + + - - Styled + + - - + + - - + + - - + + - - + + - - Object + + Object - - - - - - - elementInfo + + + + + + + elementInfo - - + + - - - + + String - - + + + + + + + CLASS_NAME - - Element + + - - Element + + + - - + + - - + + Element - - + + Element - - + + - - Object + + - - - - - - - elementInfo + + - - + + - - - + + HashMap<String, ElementPropertyInfo> - - + + + + + elements - - Element + + - - Element + + Object - - + + + + + attributes - - + + - - + + Object - - + + + + + anyAttribute - - + + - - + + Object - - String + + + + + value - - - - - key + + - - + + Object - - String + + + + + any - - - - - namespaceURI + + - - + + + - - String + + - - - - - localPart + + Structure - - + + Structure - - String + + - - - - - prefix + + - - + + - - String + + - - - - - string + + - - + + - - - + + Object - - + + + + + attributeName - - QName + + - - QName + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + AttributePropertyInfo + + + AttributePropertyInfo + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - * - 1 - - + + 1 + 1 + + - + - - 1 - 1 - - + + 1 + 1 + + - + - - 1 - 1 - - + + 1 + 1 + + - + - - 1 - 1 - - + + * + 1 + + - + - - 1 - 1 - - + + 1 + 1 + + - + - - 1 - 1 - - + + * + 1 + + - + - - * - 1 + + 1 + 1 diff --git a/typescript/src/main/typescript/Jsonix.d.ts b/typescript/src/main/typescript/Jsonix.d.ts index ebb9ed640..3b251b23d 100644 --- a/typescript/src/main/typescript/Jsonix.d.ts +++ b/typescript/src/main/typescript/Jsonix.d.ts @@ -10,35 +10,35 @@ interface Unmarshaller { //TODO: @see createUnmarshaller * @param {string} arg (description) * @returns {Object} (description) */ - unmarshalString(arg: string): Object; + unmarshalString(arg:string): Object; /** * (description) - * + * * @param {string} fileName (description) * @param {(unmarshalled:Object)=> void} callback (description) * @param {Object} options (description) */ - unmarshalFile(fileName: string, callback: (unmarshalled: Object) => void, options: Object): void; + unmarshalFile(fileName:string, callback:(unmarshalled:Object) => void, options:Object): void; /** * (description) - * + * * @param {string} url (description) * @param {(unmarshalled:Object)=> void} callback (description) * @param {Object} options (description) */ - unmarshalURL(url: string, callback: (unmarshalled: Object) => void, options: Object): void; + unmarshalURL(url:string, callback:(unmarshalled:Object) => void, options:Object): void; /** * (description) - * + * * @param {Element} doc (description) * @param {string} scope (description) * @returns {Object} (description) */ - unmarshalDocument(doc: Element, scope: string): Object; + unmarshalDocument(doc:Element, scope:string): Object; } /** * (description) @@ -48,19 +48,19 @@ interface Unmarshaller { //TODO: @see createUnmarshaller interface Marshaller { // TODO: generics like marshalString(object:T):string; /** * (description) - * + * * @param {Object} object (description) * @returns {string} (description) */ - marshalString(object: Object): string; + marshalString(object:Object): string; /** * (description) - * + * * @param {Object} object (description) * @returns {Element} (description) */ - marshalDocument(object: Object): Element; + marshalDocument(object:Object): Element; } declare module Jsonix { @@ -70,7 +70,7 @@ declare module Jsonix { * * @param {any[]} s (description) */ - constructor(s: any[]); + constructor(s:any[]); /** * (description) @@ -78,7 +78,7 @@ declare module Jsonix { * @param {string} name (description) * @returns {TypeInfo} (description) */ - getTypeInfoByName(name: string): TypeInfo; + getTypeInfoByName(name:string):TypeInfo; /** * (description) @@ -86,7 +86,7 @@ declare module Jsonix { * @param {string} typeName (description) * @returns {TypeInfo} (description) */ - getTypeInfoByTypeName(typeName: string): TypeInfo; + getTypeInfoByTypeName(typeName:string):TypeInfo; /** * (description) @@ -94,75 +94,75 @@ declare module Jsonix { * @param {string} typeNameKey (description) * @returns {TypeInfo} (description) */ - getTypeInfoByTypeNameKey(typeNameKey: string): TypeInfo; + getTypeInfoByTypeNameKey(typeNameKey:string):TypeInfo; - getElementInfo(name: string, scope: string): any; + getElementInfo(name:string, scope:string):any; - getSubstitutionMembers(name: string): any; + getSubstitutionMembers(name:string):any; - createMarshaller(): Marshaller; + createMarshaller():Marshaller; - createUnmarshaller(): Unmarshaller; + createUnmarshaller():Unmarshaller; //TODO: createUnmarshaller(type: T): Unmarshaller; - getNamespaceURI(prefix: string): any; + getNamespaceURI(prefix:string):any; - getPrefix(namespaceURI: string, defaultPrefix: string): any; + getPrefix(namespaceURI:string, defaultPrefix:string):any; - builtinTypeInfos: { + builtinTypeInfos:{ Jsonix: { Schema: { XSD: { - AnyType: { INSTANCE: {} }, - AnySimpleType: { INSTANCE: {} }, - AnyURI: { INSTANCE: {} }, - Base64Binary: { INSTANCE: {} }, - Boolean: { INSTANCE: {} }, - Byte: { INSTANCE: {} }, - Calendar: { INSTANCE: {} }, - DateAsDate: { INSTANCE: {} }, - Date: { INSTANCE: {} }, - DateTimeAsDate: { INSTANCE: {} }, - DateTime: { INSTANCE: {} }, - Decimal: { INSTANCE: {} }, - Double: { INSTANCE: {} }, - Duration: { INSTANCE: {} }, - Float: { INSTANCE: {} }, - GDay: { INSTANCE: {} }, - GMonth: { INSTANCE: {} }, - GMonthDay: { INSTANCE: {} }, - GYear: { INSTANCE: {} }, - GYearMonth: { INSTANCE: {} }, - HexBinary: { INSTANCE: {} }, - ID: { INSTANCE: {} }, - IDREF: { INSTANCE: {} }, - IDREFS: { INSTANCE: {} }, - Int: { INSTANCE: {} }, - Integer: { INSTANCE: {} }, - Language: { INSTANCE: {} }, - Long: { INSTANCE: {} }, - Name: { INSTANCE: {} }, - NCName: { INSTANCE: {} }, - NegativeInteger: { INSTANCE: {} }, - NMToken: { INSTANCE: {} }, - NMTokens: { INSTANCE: {} }, - NonNegativeInteger: { INSTANCE: {} }, - NonPositiveInteger: { INSTANCE: {} }, - NormalizedString: { INSTANCE: {} }, - Number: { INSTANCE: {} }, - PositiveInteger: { INSTANCE: {} }, - QName: { INSTANCE: {} }, - Short: { INSTANCE: {} }, - String: { INSTANCE: {} }, - Strings: { INSTANCE: {} }, - TimeAsDate: { INSTANCE: {} }, - Time: { INSTANCE: {} }, - Token: { INSTANCE: {} }, - UnsignedByte: { INSTANCE: {} }, - UnsignedInt: { INSTANCE: {} }, - UnsignedLong: { INSTANCE: {} }, - UnsignedShort: { INSTANCE: {} }, + AnyType: { INSTANCE: {} }; + AnySimpleType: { INSTANCE: {} }; + AnyURI: { INSTANCE: {} }; + Base64Binary: { INSTANCE: {} }; + Boolean: { INSTANCE: {} }; + Byte: { INSTANCE: {} }; + Calendar: { INSTANCE: {} }; + DateAsDate: { INSTANCE: {} }; + Date: { INSTANCE: {} }; + DateTimeAsDate: { INSTANCE: {} }; + DateTime: { INSTANCE: {} }; + Decimal: { INSTANCE: {} }; + Double: { INSTANCE: {} }; + Duration: { INSTANCE: {} }; + Float: { INSTANCE: {} }; + GDay: { INSTANCE: {} }; + GMonth: { INSTANCE: {} }; + GMonthDay: { INSTANCE: {} }; + GYear: { INSTANCE: {} }; + GYearMonth: { INSTANCE: {} }; + HexBinary: { INSTANCE: {} }; + ID: { INSTANCE: {} }; + IDREF: { INSTANCE: {} }; + IDREFS: { INSTANCE: {} }; + Int: { INSTANCE: {} }; + Integer: { INSTANCE: {} }; + Language: { INSTANCE: {} }; + Long: { INSTANCE: {} }; + Name: { INSTANCE: {} }; + NCName: { INSTANCE: {} }; + NegativeInteger: { INSTANCE: {} }; + NMToken: { INSTANCE: {} }; + NMTokens: { INSTANCE: {} }; + NonNegativeInteger: { INSTANCE: {} }; + NonPositiveInteger: { INSTANCE: {} }; + NormalizedString: { INSTANCE: {} }; + Number: { INSTANCE: {} }; + PositiveInteger: { INSTANCE: {} }; + QName: { INSTANCE: {} }; + Short: { INSTANCE: {} }; + String: { INSTANCE: {} }; + Strings: { INSTANCE: {} }; + TimeAsDate: { INSTANCE: {} }; + Time: { INSTANCE: {} }; + Token: { INSTANCE: {} }; + UnsignedByte: { INSTANCE: {} }; + UnsignedInt: { INSTANCE: {} }; + UnsignedLong: { INSTANCE: {} }; + UnsignedShort: { INSTANCE: {} }; } } } @@ -170,7 +170,7 @@ declare module Jsonix { // private - elementInfos: ClassInfo[]; + elementInfos:ClassInfo[]; } } @@ -182,7 +182,7 @@ declare module Jsonix { * @interface Styled */ interface Styled { - //{ CLASS_NAME: string }, + CLASS_NAME: string; mappingStyle: Object; } @@ -193,6 +193,7 @@ interface Styled { * @interface QName */ interface QName { + CLASS_NAME: string; key: string; namespaceURI: string; localPart: string; @@ -207,16 +208,34 @@ interface QName { * @interface TypeInfo */ interface TypeInfo { - name: string, - baseTypeInfo: TypeInfo, + name: string; + baseTypeInfo: TypeInfo; +} + +/** + * (description) + * + * @interface EnumLeafInfo + * @extends {TypeInfo} + */ +interface EnumLeafInfo extends TypeInfo { + name: string; + baseTypeInfo: TypeInfo; + entries: { [name: string]: string }; + keys: { [index: number]: string }; + values: { [index: number]: string }; + built: boolean; + } + /** * (description) * * @interface PropertyInfo */ interface PropertyInfo { + CLASS_NAME: string; name: string; collection: boolean; targetNamespace: string; @@ -246,7 +265,7 @@ interface AbstractElementPropertyInfo extends PropertyInfo { * @extends {AbstractElementPropertyInfo} */ interface ElementPropertyInfo extends AbstractElementPropertyInfo { - typeInfo: ClassInfo | string; + typeInfo: TypeInfo | string; elementName: QName; } @@ -259,6 +278,7 @@ interface ElementPropertyInfo extends AbstractElementPropertyInfo { * @extends {Styled} */ interface ClassInfo extends TypeInfo, Styled { + CLASS_NAME: string; localName: string; typeName: QName; instanceFactory: {}; @@ -266,20 +286,20 @@ interface ClassInfo extends TypeInfo, Styled { propertiesMap: { [name: string]: PropertyInfo }; //is inner class structure: { - elements: { [fqn: string]: PropertyInfo }, - attributes: {}, - anyAttribute: {}, - value: {}, + elements: { [fqn: string]: PropertyInfo }; + attributes: {}; + anyAttribute: {}; + value: {}; any: {} }; - targetNamespace: string, - defaultElementNamespaceURI: string, + targetNamespace: string; + defaultElementNamespaceURI: string; defaultAttributeNamespaceURI: string - built: boolean, + built: boolean; //TODO: confirm this syntax propertyInfoCreators: { aa: { aa }; - anyAttribute: { aa }, + anyAttribute: { aa }; ae: { ae }; anyElement: { ae }; a: { a };