Refine search
public static KeywordsType keywords(List<String> keywords) { if (keywords == null || keywords.size() == 0) { return null; } KeywordsType kw = f.createKeywordsType(); for (String keyword : keywords) { kw.getKeyword().add(languageString(keyword)); } return kw; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EAttribute getCalendar_Id() { return (EAttribute)calendarEClass.getEStructuralFeatures().get(1); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: return property != null && !property.isEmpty(); } return super.eIsSet(featureID); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: getProperty().clear(); getProperty().addAll((Collection<? extends PropertyType>)newValue); return; } super.eSet(featureID, newValue); }
uniformDistrobutionType.setMin(180.0); uniformDistrobutionType.setMax(600.0); processingTimeParameter.getParameterValue().add(uniformDistrobutionType); elementTimeParams.setProcessingTime(processingTimeParameter); elementParams.setTimeParameters(elementTimeParams); defaultScenario.getElementParameters().add(elementParams); bpsimData.getScenario().add(defaultScenario); inResource.getContents().add(documentRoot); StringWriter stringWriter = new StringWriter(); inResource.save(stringWriter, null); DocumentRoot outRoot = (DocumentRoot) outResource.getContents().get(0); assertNotNull(outRoot.getBPSimData()); assertEquals(outAnalysisData.getScenario().size(), 1); Scenario outScenario = outAnalysisData.getScenario().get(0); assertEquals(outScenario.getElementParameters().size(), 1); assertEquals(outScenario.getId(), "default"); assertEquals(outScenario.getName(), "Scenario"); assertNotNull(outScenario.getScenarioParameters()); assertNotNull(outScenario.getElementParameters()); assertEquals(outScenario.getElementParameters().size(), 1); ElementParameters outElementParamType = outScenario.getElementParameters().get(0); assertNotNull(outElementParamType.getTimeParameters()); TimeParameters outTimeParams = outElementParamType.getTimeParameters(); assertNotNull(outTimeParams.getProcessingTime()); assertEquals(outTimeParams.getProcessingTime().getParameterValue().size(), 1); UniformDistributionType outDistributionType = (UniformDistributionType) outTimeParams.getProcessingTime().getParameterValue().get(0);
public EAttribute createEAttribute(EClass eClass, String name, EDataType eDataType, Multiplicity multiplicity) { EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute(); eAttribute.setName(name); if (multiplicity == Multiplicity.MANY) { eAttribute.setUpperBound(-1); } if (!isNew(eClass)) { changes.add(new NewAttributeChange(this, eClass.getEAllStructuralFeatures().size(), eAttribute)); } eAttribute.setEType(eDataType); eClass.getEStructuralFeatures().add(eAttribute); return eAttribute; }
private void writeEmbedded(IdEObject object) throws IOException { print("{"); print("\"_t\":\"" + object.eClass().getName() + "\","); for (EStructuralFeature eStructuralFeature : object.eClass().getEAllStructuralFeatures()) { print("\"" + eStructuralFeature.getName() + "\":"); writePrimitive(eStructuralFeature, object.eGet(eStructuralFeature)); if (object.eClass().getEAllStructuralFeatures().get(object.eClass().getEAllStructuralFeatures().size()-1) != eStructuralFeature) { print(","); } } print("}"); }
private void setIfcCartesianPoint(IdEObject idEObject, float scale) { IfcCartesianPoint ifcCartesianPoint = (IfcCartesianPoint) idEObject; EList<Double> coordinates = ifcCartesianPoint.getCoordinates(); for (int index = 0; index < coordinates.size(); index++) { coordinates.set(index, coordinates.get(index) * scale); } }
public void testParseServiceException() throws Exception { String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<ows:ExceptionReport version=\"1.0.0\"\n" + " xsi:schemaLocation=\"http://www.opengis.net/ows http://demo.opengeo.org/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd\"\n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ows=\"http://www.opengis.net/ows\">\n" + " <ows:Exception exceptionCode=\"InvalidParameterValue\" locator=\"service\">\n" + " <ows:ExceptionText>No service: ( madeUp )</ows:ExceptionText>\n" + " </ows:Exception>\n" + "</ows:ExceptionReport>\n" + ""; document = dom(xml); Object result = parse(OWS.EXCEPTIONREPORT); assertNotNull(result); assertTrue(result instanceof ExceptionReportType); ExceptionReportType er = (ExceptionReportType) result; assertEquals("1.0.0", er.getVersion()); assertEquals(1, er.getException().size()); ExceptionType ex = (ExceptionType) er.getException().get(0); assertEquals("InvalidParameterValue", ex.getExceptionCode()); assertEquals("service", ex.getLocator()); assertEquals(1, ex.getExceptionText().size()); assertEquals("No service: ( madeUp )", ex.getExceptionText().get(0)); } }
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { InsertResultsType resultType = (InsertResultsType) super.parse(instance, node, value); // remove 'none' Iterator it = resultType.getFeature().iterator(); while (it.hasNext()) { EList fids = ((InsertedFeatureType) it.next()).getFeatureId(); if (fids.size() == 1 && "none".equals(fids.get(0).toString())) { it.remove(); } } return resultType; } }
public static ExceptionReportType exceptionReport( ServiceException exception, boolean verboseExceptions, String version) { ExceptionType e = f.createExceptionType(); if (exception.getCode() != null) { e.setExceptionCode(exception.getCode()); } else { // set a default e.setExceptionCode("NoApplicableCode"); } e.setLocator(exception.getLocator()); // add the message StringBuffer sb = new StringBuffer(); OwsUtils.dumpExceptionMessages(exception, sb, true); e.getExceptionText().add(sb.toString()); e.getExceptionText().addAll(exception.getExceptionText()); if (verboseExceptions) { // add the entire stack trace // exception. e.getExceptionText().add("Details:"); ByteArrayOutputStream trace = new ByteArrayOutputStream(); exception.printStackTrace(new PrintStream(trace)); e.getExceptionText().add(new String(trace.toByteArray())); } ExceptionReportType report = f.createExceptionReportType(); version = version != null ? version : "1.1.0"; report.setVersion(version); report.getException().add(e); return report; }
private void clean() { Iterator<EClassifier> iterator = schemaPack.getEClassifiers().iterator(); while (iterator.hasNext()) { EClassifier eClassifier = iterator.next(); if (eClassifier instanceof EClass) { EClass eClass = (EClass) eClassifier; if (eClass.getEAnnotation("wrapped") != null) { if (eClass.getESuperTypes().size() == 1) { // iterator.remove(); } } } } }
betaDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); binomialDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); booleanParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); constantParameterEClass.getESuperTypes().add(this.getParameterValue()); dateTimeParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); distributionParameterEClass.getESuperTypes().add(this.getParameterValue()); durationParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); elementParametersTypeEClass.getESuperTypes().add(this.getElementParameters()); enumParameterTypeEClass.getESuperTypes().add(this.getParameterValue()); erlangDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); expressionParameterTypeEClass.getESuperTypes().add(this.getParameterValue()); floatingParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); gammaDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); logNormalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); negativeExponentialDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); normalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); numericParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); poissonDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); propertyTypeEClass.getESuperTypes().add(this.getParameter()); scenarioParametersTypeEClass.getESuperTypes().add(this.getScenarioParameters()); stringParameterTypeEClass.getESuperTypes().add(this.getConstantParameter()); triangularDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); truncatedNormalDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); uniformDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); userDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter()); weibullDistributionTypeEClass.getESuperTypes().add(this.getDistributionParameter());
private Revision createNewVirtualRevision(DatabaseSession session, Project project, ConcreteRevision concreteRevision, String comment, Date date, User user, long size) throws BimserverLockConflictException, BimserverDatabaseException { Revision revision = session.create(Revision.class); revision.setLastConcreteRevision(concreteRevision); revision.setComment(comment); revision.setDate(date); revision.setUser(user); revision.setSize(size); revision.setId(project.getRevisions().size() + 1); revision.getConcreteRevisions().add(concreteRevision); revision.setProject(project); return revision; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BpsimPackage.PROPERTY_PARAMETERS__PROPERTY: getProperty().clear(); return; } super.eUnset(featureID); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { SectionsType sections = owsfactory.createSectionsType(); sections.getSection().addAll(node.getChildValues("Section")); return sections; } }
for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (ft.getName().equals(element.getName())) { for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition typedef = (XSDTypeDefinition) t.next(); if ((ft.getName() + "_Type").equals(typedef.getName())) {
/** * Copies all the properties from one object to anoter. * * @param source The object to copy from. * @param target The object to copy to. */ public static void copy(EObject source, EObject target) { for (Iterator i = source.eClass().getEStructuralFeatures().iterator(); i.hasNext(); ) { EStructuralFeature feature = (EStructuralFeature) i.next(); target.eSet(feature, source.eGet(feature)); } } }
public static int getNrOfProperties(org.bimserver.models.ifc4.IfcProduct ifcProduct) { int nrProperties = 0; for (org.bimserver.models.ifc4.IfcRelDefines ifcRelDefines : ifcProduct.getIsDefinedBy()) { if (ifcRelDefines instanceof org.bimserver.models.ifc4.IfcRelDefinesByProperties) { org.bimserver.models.ifc4.IfcRelDefinesByProperties ifcRelDefinesByProperties = (org.bimserver.models.ifc4.IfcRelDefinesByProperties) ifcRelDefines; org.bimserver.models.ifc4.IfcPropertySetDefinitionSelect propertySetDefinition = ifcRelDefinesByProperties.getRelatingPropertyDefinition(); if (propertySetDefinition instanceof org.bimserver.models.ifc4.IfcPropertySet) { org.bimserver.models.ifc4.IfcPropertySet ifcPropertySet = (org.bimserver.models.ifc4.IfcPropertySet) propertySetDefinition; nrProperties += ifcPropertySet.getHasProperties().size(); } } } return nrProperties; }