public String convertNumericValue(final Property property) { PropertyType _type = property.getType(); PrimitiveType _type_1 = ((PrimitivePropertyType) _type).getType(); boolean _equals = Objects.equal(_type_1, PrimitiveType.BOOLEAN); if (_equals) { String _name = property.getName(); String _plus = ("(" + _name); return (_plus + " == 1 ? \"true\" : \"false\")"); } else { String _name_1 = property.getName(); String _plus_1 = ("(" + _name_1); return (_plus_1 + ")"); } } }
protected String getDescription(final Property property) { String _description = property.getDescription(); boolean _notEquals = (!Objects.equal(_description, null)); if (_notEquals) { return property.getDescription(); } else { return ""; } }
@Check public void checkConstraint(final Property prop) { ConstraintRule _constraintRule = prop.getConstraintRule(); EList<Constraint> constraints = _constraintRule.getConstraints(); final EList<Constraint> _converted_constraints = (EList<Constraint>)constraints; int _length = ((Object[])Conversions.unwrapArray(_converted_constraints, Object.class)).length; boolean _equals = (_length == 0); if (_equals) { return; } PropertyType _type = prop.getType(); PrimitivePropertyType primi = ((PrimitivePropertyType) _type); boolean isMultiplcity = prop.isMultiplicity(); for (final Constraint constraint : constraints) { this.verifyConstraintForType(primi, constraint, isMultiplcity); } }
public static FunctionblockModel convertToFlatHierarchy(FunctionblockModel fbm) { FunctionBlock fb = fbm.getFunctionblock(); // Consolidate all properties List<Property> properties = getFlatProperties(fbm); // remove super type reference if (fbm.getSuperType() != null) { removeSuperTypeModelReference(fbm); } properties.stream().filter(p -> p.getType() instanceof ObjectPropertyType) .forEach(p -> createReference(fbm, (ObjectPropertyType) p.getType())); Status status = FunctionblockFactory.eINSTANCE.createStatus(); status.getProperties().addAll(properties.stream().filter(p -> p.eContainer() instanceof Status) .collect(Collectors.toList())); fb.setStatus(status); Configuration configuration = FunctionblockFactory.eINSTANCE.createConfiguration(); configuration.getProperties().addAll(properties.stream() .filter(p -> p.eContainer() instanceof Configuration).collect(Collectors.toList())); fb.setConfiguration(configuration); // Consolidate all operations List<Operation> operations = getFlatOperations(fbm); fb.getOperations().clear(); fb.getOperations().addAll(operations); return fbm; }
_builder.newLine(); _builder.append("* "); String _description = property.getDescription(); _builder.append(_description, ""); _builder.newLineIfNotEmpty(); PropertyType _type = property.getType(); if ((_type instanceof PrimitivePropertyType)) { _builder.append("private "); PropertyType _type_1 = property.getType(); PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType(); String _mapSimpleDatatype = ValueMapper.mapSimpleDatatype(((PrimitiveType) _type_2)); _builder.append(_mapSimpleDatatype, ""); _builder.append(" "); String _name = property.getName(); _builder.append(_name, ""); _builder.append(";"); _builder.newLineIfNotEmpty(); } else { PropertyType _type_3 = property.getType(); if ((_type_3 instanceof ObjectPropertyType)) { PropertyType _type_4 = property.getType(); ObjectPropertyType object = ((ObjectPropertyType) _type_4); _builder.newLineIfNotEmpty(); _builder.append(_firstUpper, ""); _builder.append(" "); String _name_2 = property.getName(); _builder.append(_name_2, "");
@Override public String getFileName(final Property context) { String _name = context.getName(); String _plus = ("GetThingShadowLambda_" + _name); return (_plus + ".js"); }
_builder.append("\t"); _builder.append("* Property definition for "); String _name_3 = property.getName(); String _firstUpper_2 = StringExtensions.toFirstUpper(_name_3); _builder.append(_firstUpper_2, "\t"); String _description_1 = property.getDescription(); _builder.append(_description_1, "\t"); _builder.append("\")"); _builder.append("\t"); _builder.append("String PROPERTY_"); String _name_4 = property.getName(); String _upperCase = _name_4.toUpperCase(); _builder.append(_upperCase, "\t"); _builder.append(" = \""); String _name_5 = property.getName(); _builder.append(_name_5, "\t"); _builder.append("\";"); _builder.append("\t"); _builder.append("* Property definition for "); String _name_6 = property_1.getName(); String _firstUpper_3 = StringExtensions.toFirstUpper(_name_6); _builder.append(_firstUpper_3, "\t"); String _description_2 = property_1.getDescription(); _builder.append(_description_2, "\t"); _builder.append("\")");
final Presence mandatory = property.getPresence(); final boolean multiplicity = property.isMultiplicity(); final String statusPropertyName = property.getName(); final PropertyType type = property.getType(); if( type instanceof PrimitivePropertyTypeImpl ) { final String primitiveTypeStr = ( (PrimitivePropertyTypeImpl) type ).getType().toString(); String statusPropDescr = property.getDescription(); if( null == statusPropDescr ) { statusPropDescr = ""; // as default
protected String getPrimitivePropertyType(final Property property) { PropertyType _type = property.getType(); if ((_type instanceof PrimitivePropertyType)) { PropertyType _type_1 = property.getType(); PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType(); return _type_2.toString(); } else { return "UNDEFINED"; } }
_builder.append("\t"); _builder.append("var "); String _name_1 = property.getName(); _builder.append(_name_1, "\t"); _builder.append(" : "); boolean _isMultiplicity = property.isMultiplicity(); if (_isMultiplicity) { _builder.append("["); PropertyType _type = property.getType(); String _type_1 = this.getType(_type); _builder.append(_type_1, "\t"); _builder.append("]"); } else { PropertyType _type_2 = property.getType(); String _type_3 = this.getType(_type_2); _builder.append(_type_3, "\t");
String _xblockexpression = null; EObject _eContainer = property.eContainer(); EObject _eContainer_1 = _eContainer.eContainer(); EObject _eContainer_2 = _eContainer_1.eContainer(); String _string = _handleProperty.toString(); String _trim = _string.trim(); String _name_1 = property.getName(); String _plus_3 = ("\"" + _name_1); String _plus_4 = (_plus_3 + "\": {"); EObject _eContainer_3 = property.eContainer(); if ((_eContainer_3 instanceof Configuration)) { _builder.append("configuration"); EObject _eContainer_4 = property.eContainer(); if ((_eContainer_4 instanceof Status)) { _builder.append("status"); EObject _eContainer_5 = property.eContainer(); if ((_eContainer_5 instanceof Fault)) { _builder.append("fault"); String _name_2 = property.getName(); _builder.append(_name_2, "\t"); _builder.append(">\",");
public static InformationModel convertToFlatHierarchy(InformationModel infomodel) { for (FunctionblockProperty fbProperty : infomodel.getProperties()) { FunctionblockModel fbm = fbProperty.getType(); fbProperty.setType(convertToFlatHierarchy(fbm)); // merge any extended properties from information model to the FB properties if (fbProperty.getExtendedFunctionBlock() != null && fbProperty.getExtendedFunctionBlock().getStatus() != null) { for (Property extendedProperty : fbProperty.getExtendedFunctionBlock().getStatus() .getProperties()) { Optional<Property> baseProperty = fbm.getFunctionblock().getStatus().getProperties() .stream().filter(p -> p.getName().equals(extendedProperty.getName())).findFirst(); if (baseProperty.isPresent()) { baseProperty.get().setConstraintRule(extendedProperty.getConstraintRule()); } } } } return infomodel; }
Presence _presence = it.getPresence(); boolean _tripleNotEquals = (_presence != null); if (!_tripleNotEquals) { _and = false; } else { Presence _presence_1 = it.getPresence(); boolean _isMandatory = _presence_1.isMandatory(); _and = _isMandatory; String _name = property.getName(); _builder.append(_name, ""); _builder.append("\"");
private void handleRangeEnumeration( final Object lwm2mObject, final Property property, final Item item ) { if (property.getConstraintRule() != null) { final EList<Constraint> constraints = property.getConstraintRule().getConstraints(); final StringBuilder rangeSb = new StringBuilder(); for( final Constraint constraint : constraints ) { final ConstraintIntervalType type = constraint.getType(); final String constraintValues = constraint.getConstraintValues(); if( type == ConstraintIntervalType.MIN ) { rangeSb.append( constraintValues ).append( '-' ); } else if( type == ConstraintIntervalType.MAX ) { rangeSb.append( constraintValues ); } else if( type == ConstraintIntervalType.STRLEN ) { rangeSb.append( "0-" ).append( constraintValues ).append( " bytes" ); } else { final String errMsg = unsupportedValueForPropertyMsg( "ConstraintIntervalType <" + type + ">", property, lwm2mObject ); throw new IllegalArgumentException( errMsg ); } } item.setRangeEnumeration( rangeSb.toString() ); } }
_builder.newLine(); _builder.append("* "); String _description = property.getDescription(); _builder.append(_description, ""); _builder.newLineIfNotEmpty(); PropertyType _type = property.getType(); if ((_type instanceof PrimitivePropertyType)) { CharSequence _addFieldAnnotations = this.addFieldAnnotations(property); _builder.newLineIfNotEmpty(); _builder.append("private "); PropertyType _type_1 = property.getType(); PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType(); String _mapSimpleDatatype = ValueMapper.mapSimpleDatatype(((PrimitiveType) _type_2)); _builder.append(_mapSimpleDatatype, ""); _builder.append(" "); String _name = property.getName(); String _normalize = ValueMapper.normalize(_name); _builder.append(_normalize, ""); _builder.newLineIfNotEmpty(); } else { PropertyType _type_3 = property.getType(); if ((_type_3 instanceof ObjectPropertyType)) { PropertyType _type_4 = property.getType(); ObjectPropertyType object = ((ObjectPropertyType) _type_4); _builder.newLineIfNotEmpty();
public static boolean isEventable(Property property, FunctionBlock fb) { if (findEventByName(property.getName(), fb) != null) { return true; } return false; }
_builder.newLine(); _builder.append("\t"); String _name = property.getName(); String _replace = _name.replace("_", "\\_"); _builder.append(_replace, "\t"); _builder.append(_propertyType, "\t"); _builder.append(" & "); String _description = property.getDescription(); _builder.append(_description, "\t"); _builder.newLineIfNotEmpty();
public static CharSequence handleProperty(final Property property, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); PropertyType propertyType = property.getType(); _builder.newLineIfNotEmpty(); boolean _isMultiplicity = property.isMultiplicity(); if (_isMultiplicity) { _builder.append("\""); String _name = property.getName(); _builder.append(_name, ""); _builder.append("\": {"); String _description = property.getDescription(); boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_description); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append("\"description\": \""); String _description_1 = property.getDescription(); _builder.append(_description_1, "\t"); _builder.append("\","); String _trim = _string.trim(); _builder.append(_trim, "\t\t"); ConstraintRule _constraintRule = property.getConstraintRule(); CharSequence _constraintsContent = Utils.getConstraintsContent(_constraintRule, invocationContext); _builder.append(_constraintsContent, "\t\t"); } else { _builder.append("\""); String _name_1 = property.getName();
public Collection<Model> getReferenceModels(final Collection<Property> properties) { final ArrayList<Model> models = Lists.<Model>newArrayList(); for (final Property property : properties) { PropertyType _type = property.getType(); Collection<Model> _referenceModels = this.getReferenceModels(_type); models.addAll(_referenceModels); } return models; }
characteristic.setName(map.getAttributeValue("name", "")); } else { characteristic.setName(((FunctionblockModel)(property.eContainer().eContainer().eContainer())).getName() + property.getName());