@Override public EList<String> getBundles () { return ECollections.asEList ( "org.openscada.external.postgresql" ); //$NON-NLS-1$ }
@Override public Object eGet(EStructuralFeature eStructuralFeature) { EClassifier eType = eStructuralFeature.getEType(); String name = eStructuralFeature.getName(); Method method = PropertySwitch.GETTERS.get(eStructuralFeature); try { Object result = method.invoke(extendedMetaData, eNamedElement); if (name.equals("wildcards")) { @SuppressWarnings("unchecked") EList<String> wildcards = ECollections.asEList((List<String>)result); int index = wildcards.indexOf(null); if (index != -1) { wildcards.set(index, "##local"); } return wildcards; } else { return eType instanceof EEnum ? ((EEnum)eType).getEEnumLiteral((Integer)result) : eStructuralFeature.isMany() ? ECollections.asEList((List<?>)result) : result; } } catch (Exception exception) { throw new RuntimeException(exception); } }
public static EList<Example> getAllExamples(TypedMessage message) { if (!message.getExamples().isEmpty()) { return message.getExamples(); } ResourceDefinition resource = message.getResourceType(); if (resource != null) { EList<Example> resourceExamples = resource.getExamples(); if (!resourceExamples.isEmpty()) { return resourceExamples; } if (resource instanceof ServiceDataResource) { Structure dataType = ((ServiceDataResource) resource).getDataType(); List<Example> result = new ArrayList<Example>(dataType.getDataExamples().size()); for (DataExample dataExample : dataType.getDataExamples()) { result.add(toExample(dataExample)); } return ECollections.asEList(result); } } return ECollections.emptyEList(); }