buffer.putLong((Long) value); } else if (type == EcorePackage.eINSTANCE.getEShort() || type == EcorePackage.eINSTANCE.getEShortObject()) { if (value == null) { buffer.putShort((short)0);
@Override public void migrate(Schema schema, DatabaseSession databaseSession) { EClass geometryData = schema.getEClass("geometry", "GeometryData"); EClass geometryInfo = schema.getEClass("geometry", "GeometryInfo"); schema.createEAttribute(geometryData, "reused", EcorePackage.eINSTANCE.getEInt()); schema.createEAttribute(geometryData, "type", EcorePackage.eINSTANCE.getEShort()); schema.createEAttribute(geometryInfo, "ifcProductOid", EcorePackage.eINSTANCE.getELong()); }
buffer.putInt((Integer) value); } else if (type == EcorePackage.eINSTANCE.getEShort() || type == EcorePackage.eINSTANCE.getEShortObject()) { if (value == null) { buffer.putShort((short) 0);
private int getPrimitiveSize(EDataType eDataType, Object val) { if (eDataType == EcorePackage.eINSTANCE.getEInt() || eDataType == EcorePackage.eINSTANCE.getEIntegerObject()) { return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEFloat() || eDataType == EcorePackage.eINSTANCE.getEFloatObject()) { return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEBoolean() || eDataType == EcorePackage.eINSTANCE.getEBooleanObject()) { return 1; } else if (eDataType == EcorePackage.eINSTANCE.getEDate()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getEShort()) { return 2; } else if (eDataType == EcorePackage.eINSTANCE.getELong() || eDataType == EcorePackage.eINSTANCE.getELongObject()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getEDouble() || eDataType == EcorePackage.eINSTANCE.getEDoubleObject()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getEString()) { if (val != null) { return 4 + ((String) val).getBytes(Charsets.UTF_8).length; } return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEByteArray()) { if (val != null) { return 4 + ((byte[]) val).length; } return 4; } else if (eDataType instanceof EEnum) { return 4; } throw new RuntimeException("Unimplemented: " + eDataType); }
} else if (classifier == EcorePackage.eINSTANCE.getEShort() || classifier == EcorePackage.eINSTANCE.getEShortObject()) { return buffer.getShort(); } else if (classifier == EcorePackage.eINSTANCE.getELong() || classifier == EcorePackage.eINSTANCE.getELongObject()) {
} else if (eClassifier == EcorePackage.eINSTANCE.getEInt()) { return jsonReader.nextInt(); } else if (eClassifier == EcorePackage.eINSTANCE.getEShort()) { return (short)jsonReader.nextInt(); } else if (eClassifier == EcorePackage.eINSTANCE.getELong()) {
} else if (classifier == EcorePackage.eINSTANCE.getEDouble() || classifier == EcorePackage.eINSTANCE.getEDoubleObject()) { return buffer.getDouble(); } else if (classifier == EcorePackage.eINSTANCE.getEShort() || classifier == EcorePackage.eINSTANCE.getEShortObject()) { return buffer.getShort(); } else if (classifier == EcorePackage.eINSTANCE.getEBoolean() || classifier == EcorePackage.eINSTANCE.getEBooleanObject()) {
initEAttribute ( getSerialToNetworkMapping_Xonxoff (), ecorePackage.getEBoolean (), "xonxoff", "false", 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getSerialToNetworkMapping_Rtscts (), ecorePackage.getEBoolean (), "rtscts", "false", 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getSerialToNetworkMapping_DataBits (), ecorePackage.getEShort (), "dataBits", "8", 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getSerialToNetworkMapping_StopBits (), ecorePackage.getEShort (), "stopBits", "1", 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getSerialToNetworkMapping_ModemControl (), ecorePackage.getEBoolean (), "modemControl", null, 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getSerialToNetworkMapping_Break (), ecorePackage.getEBoolean (), "break", null, 1, 1, SerialToNetworkMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$
private String convertType(EClassifier type) { if (type == EcorePackage.eINSTANCE.getEDouble() || type == EcorePackage.eINSTANCE.getEDoubleObject()) { return "double"; } else if (type == EcorePackage.eINSTANCE.getEInt() || type == EcorePackage.eINSTANCE.getEIntegerObject()) { return "int"; } else if (type == EcorePackage.eINSTANCE.getEShort() || type == EcorePackage.eINSTANCE.getEShortObject()) { return "short"; } else if (type == EcorePackage.eINSTANCE.getEBoolean() || type == EcorePackage.eINSTANCE.getEBooleanObject()) { return "boolean"; } else if (type == EcorePackage.eINSTANCE.getEByteArray()) { return "bytearray"; } else if (type == EcorePackage.eINSTANCE.getELong() || type == EcorePackage.eINSTANCE.getELongObject()) { return "long"; } else if (type == EcorePackage.eINSTANCE.getEString()) { return "string"; } else if (type instanceof EEnum) { return "enum"; } return type.getName(); } }
initEAttribute ( getModbusDevice_Port (), ecorePackage.getEShort (), "port", null, 1, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getModbusDevice_ProtocolType (), this.getProtocolType (), "protocolType", "TCP", 1, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getModbusDevice_InterFrameDelay (), ecorePackage.getEDoubleObject (), "interFrameDelay", null, 0, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$
public int getPrimitiveSize(EDataType eDataType, Object val) { if (eDataType == EcorePackage.eINSTANCE.getEInt() || eDataType == EcorePackage.eINSTANCE.getEIntegerObject()) { return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEShort() || eDataType == EcorePackage.eINSTANCE.getEShortObject()) { return 2; } else if (eDataType == EcorePackage.eINSTANCE.getEFloat() || eDataType == EcorePackage.eINSTANCE.getEFloatObject()) { return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEBoolean() || eDataType == EcorePackage.eINSTANCE.getEBooleanObject()) { return 1; } else if (eDataType == EcorePackage.eINSTANCE.getEDate()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getELong() || eDataType == EcorePackage.eINSTANCE.getELongObject()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getEDouble() || eDataType == EcorePackage.eINSTANCE.getEDoubleObject()) { return 8; } else if (eDataType == EcorePackage.eINSTANCE.getEString()) { if (val != null) { return 4 + ((String) val).getBytes(Charsets.UTF_8).length; } return 4; } else if (eDataType == EcorePackage.eINSTANCE.getEByteArray()) { if (val != null) { return 4 + ((byte[]) val).length; } return 4; } else if (eDataType instanceof EEnum) { return 4; } throw new RuntimeException("Unimplemented: " + eDataType); }
initEAttribute ( getModbusDevice_Port (), ecorePackage.getEShort (), "port", null, 1, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getModbusDevice_ProtocolType (), this.getProtocolType (), "protocolType", "TCP", 1, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEAttribute ( getModbusDevice_InterFrameDelay (), ecorePackage.getEDoubleObject (), "interFrameDelay", null, 0, 1, ModbusDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$
} else if (eType == EcorePackage.eINSTANCE.getELong() || eType == EcorePackage.eINSTANCE.getELongObject()) { return "Long"; } else if (eType == EcorePackage.eINSTANCE.getEShort() || eType == EcorePackage.eINSTANCE.getEShortObject()) { return "Short"; } else if (eType == EcorePackage.eINSTANCE.getEDouble() || eType == EcorePackage.eINSTANCE.getEDoubleObject()) {
initEAttribute(getJvmShortAnnotationValue_Values(), ecorePackage.getEShort(), "values", null, 0, -1, JvmShortAnnotationValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
classifierDefaultMapping.put(EcorePackage.eINSTANCE.getELong(), DBType.BIGINT); classifierDefaultMapping.put(EcorePackage.eINSTANCE.getELongObject(), DBType.BIGINT); classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEShort(), DBType.SMALLINT); classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEShortObject(), DBType.SMALLINT); classifierDefaultMapping.put(EcorePackage.eINSTANCE.getEString(), DBType.VARCHAR);
addEOperation(jvmFieldEClass, ecorePackage.getEShort(), "getConstantValueAsShort", 0, 1, IS_UNIQUE, IS_ORDERED); initEAttribute(getJvmShortAnnotationValue_Values(), ecorePackage.getEShort(), "values", null, 0, -1, JvmShortAnnotationValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute ( getDaveDevice_Rack (), ecorePackage.getEShort (), "rack", null, 1, 1, DaveDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getDaveDevice_Slot (), ecorePackage.getEShort (), "slot", null, 1, 1, DaveDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getDaveDevice_Blocks (), this.getDaveBlockDefinition (), this.getDaveBlockDefinition_Device (), "blocks", null, 0, -1, DaveDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getDaveDevice_TypeSystem (), theMemoryPackage.getTypeSystem (), null, "typeSystem", null, 1, 1, DaveDevice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$
initEReference ( getExporterItemInterceptor_ProtocolOptions (), this.getProtocolOptions (), null, "protocolOptions", null, 0, 1, ExporterItemInterceptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEReference ( getExporterItemInterceptor_DataModuleOptions (), this.getDataModuleOptions (), null, "dataModuleOptions", null, 0, 1, ExporterItemInterceptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getExporterItemInterceptor_Port (), ecorePackage.getEShort (), "port", "2404", 1, 1, ExporterItemInterceptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ //$NON-NLS-2$ initEReference ( getExporterItemInterceptor_HiveProperties (), theWorldPackage.getPropertyEntry (), null, "hiveProperties", null, 0, -1, ExporterItemInterceptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$ initEAttribute ( getExporterItemInterceptor_SpontaneousBufferWindow (), theEcorePackage.getELongObject (), "spontaneousBufferWindow", null, 0, 1, ExporterItemInterceptor.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED ); //$NON-NLS-1$