org.eclipse.vorto.codegen.utils.Utils类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.eclipse.vorto.codegen.utils.Utils类的一些代码示例,展示了Utils类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils类的具体详情如下:
包路径:org.eclipse.vorto.codegen.utils.Utils
类名称:Utils

Utils介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.prosystfi

Set<String> imports = new HashSet<>();
FunctionBlock fb = fbp.getType().getFunctionblock();
for (Entity entity : Utils.getReferencedEntities(fb)) {
  if (! visited.contains(entity)) {
    generateForEntity(infomodel, ctx, entity, zipOutputter);
  exports.add(entity.getNamespace());
for (Enum en : Utils.getReferencedEnums(fb)) {
  if (! visited.contains(en)) {
    generateForEnum(infomodel, ctx, en, zipOutputter);

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap

private String getResourceConfiguration(final Property property) {
  String readable = "false";
  String writeable = "false";
  String eventable = "false";
  String result = "new Resource.Configuration(";
  boolean _isReadable = Utils.isReadable(property);
  if (_isReadable) {
   readable = "GET";
  }
  boolean _isWritable = Utils.isWritable(property);
  if (_isWritable) {
   writeable = "PUT";
  }
  boolean _isEventable = Utils.isEventable(property);
  if (_isEventable) {
   eventable = "OBSERVE";
  }
  return ((((((result + readable) + ", ") + writeable) + ", false, false, false, ") + eventable) + ")");
 }
}

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex

_builder.append(_replace, "\t");
_builder.append(" & ");
String _propertyType = Utils.getPropertyType(property);
_builder.append(_propertyType, "\t");
_builder.append(" & ");
 boolean _isEventable = Utils.isEventable(property);
 if (_isEventable) {
  _or_1 = true;
 } else {
  boolean _isReadable = Utils.isReadable(property);
  _or_1 = _isReadable;
  _or = true;
 } else {
  boolean _isWritable = Utils.isWritable(property);
  _or = _isWritable;
   boolean _isReadable_1 = Utils.isReadable(property);
   if (_isReadable_1) {
    _builder.append("\t");
   boolean _isWritable_1 = Utils.isWritable(property);
   if (_isWritable_1) {
    _builder.append("\t");
   boolean _isEventable_1 = Utils.isEventable(property);
   if (_isEventable_1) {
    _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex

_builder.append(_replace, "\t");
_builder.append(" & ");
String _propertyType = Utils.getPropertyType(property);
_builder.append(_propertyType, "\t");
_builder.append(" & ");
String _minConstraint = Utils.getMinConstraint(property);
_builder.append(_minConstraint, "\t");
_builder.append("&");
String _maxConstraint = Utils.getMaxConstraint(property);
_builder.append(_maxConstraint, "\t");
_builder.append("& \\\\");
 boolean _isEventable = Utils.isEventable(property);
 if (_isEventable) {
  _or_1 = true;
 } else {
  boolean _isReadable = Utils.isReadable(property);
  _or_1 = _isReadable;
  _or = true;
 } else {
  boolean _isWritable = Utils.isWritable(property);
  _or = _isWritable;
   boolean _isReadable_1 = Utils.isReadable(property);
   if (_isReadable_1) {
    _builder.append("\t\t");
   boolean _isWritable_1 = Utils.isWritable(property);

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap

for(final Property property : _properties) {
  boolean _isReadable = Utils.isReadable(property);
  if (_isReadable) {
  boolean _isWritable = Utils.isWritable(property);
  if (_isWritable) {
   _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino

_and = false;
} else {
 EList<org.eclipse.vorto.core.api.model.datatype.Enum> _referencedEnums = Utils.getReferencedEnums(fb);
 boolean _isEmpty = _referencedEnums.isEmpty();
 boolean _not = (!_isEmpty);
 EList<org.eclipse.vorto.core.api.model.datatype.Enum> _referencedEnums_1 = Utils.getReferencedEnums(fb);
 for (final org.eclipse.vorto.core.api.model.datatype.Enum enum_ : _referencedEnums_1) {
  boolean _and_1 = false;

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino

_and = false;
} else {
 EList<Entity> _referencedEntities = Utils.getReferencedEntities(fb);
 boolean _isEmpty = _referencedEntities.isEmpty();
 boolean _not = (!_isEmpty);
 EList<Entity> _referencedEntities_1 = Utils.getReferencedEntities(fb);
 for (final Entity entity : _referencedEntities_1) {
  boolean _and_1 = false;

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap

_builder.newLineIfNotEmpty();
 boolean _isEventable = Utils.isEventable(status);
 if (_isEventable) {
  _builder.append("\t\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex

_builder.append(_replace, "\t");
_builder.append(" & ");
String _propertyType = Utils.getPropertyType(property);
_builder.append(_propertyType, "\t");
_builder.append(" & ");
     boolean _isEventable = Utils.isEventable(property);
     if (_isEventable) {
      _or_1 = true;
     } else {
      boolean _isReadable = Utils.isReadable(property);
      _or_1 = _isReadable;
      _or = true;
     } else {
      boolean _isWritable = Utils.isWritable(property);
      _or = _isWritable;
       boolean _isReadable_1 = Utils.isReadable(property);
       if (_isReadable_1) {
        _builder.append("\t");
       boolean _isWritable_1 = Utils.isWritable(property);
       if (_isWritable_1) {
        _builder.append("\t");
       boolean _isEventable_1 = Utils.isEventable(property);
       if (_isEventable_1) {
        _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap

for(final Property property : _properties) {
  boolean _isReadable = Utils.isReadable(property);
  if (_isReadable) {
  boolean _isWritable = Utils.isWritable(property);
  if (_isWritable) {
   _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino

public String getFirstValueEnum(final FunctionBlock fb, final PropertyType type) {
 EList<org.eclipse.vorto.core.api.model.datatype.Enum> _referencedEnums = Utils.getReferencedEnums(fb);
 for (final org.eclipse.vorto.core.api.model.datatype.Enum enum_ : _referencedEnums) {
  boolean _and = false;
  String _displayname = enum_.getDisplayname();
  Type _type = ((ObjectPropertyType) type).getType();
  String _name = _type.getName();
  boolean _equals = _displayname.equals(_name);
  if (!_equals) {
   _and = false;
  } else {
   String _namespace = enum_.getNamespace();
   Type _type_1 = ((ObjectPropertyType) type).getType();
   String _namespace_1 = _type_1.getNamespace();
   boolean _equals_1 = _namespace.equals(_namespace_1);
   _and = _equals_1;
  }
  if (_and) {
   EList<EnumLiteral> _enums = enum_.getEnums();
   EnumLiteral _get = _enums.get(0);
   return _get.getName();
  }
 }
 return "";
}

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino

public EList<Property> getEntity(final FunctionBlock fb, final PropertyType type) {
  EList<Entity> _referencedEntities = Utils.getReferencedEntities(fb);
  for (final Entity entity : _referencedEntities) {
   boolean _and = false;
   String _displayname = entity.getDisplayname();
   Type _type = ((ObjectPropertyType) type).getType();
   String _name = _type.getName();
   boolean _equals = _displayname.equals(_name);
   if (!_equals) {
    _and = false;
   } else {
    String _namespace = entity.getNamespace();
    Type _type_1 = ((ObjectPropertyType) type).getType();
    String _namespace_1 = _type_1.getNamespace();
    boolean _equals_1 = _namespace.equals(_namespace_1);
    _and = _equals_1;
   }
   if (_and) {
    return entity.getProperties();
   }
  }
  return null;
 }
}

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap

_builder.newLineIfNotEmpty();
 boolean _isEventable = Utils.isEventable(status);
 if (_isEventable) {
  _builder.append("\t\t");

代码示例来源:origin: org.eclipse.vorto/boschiotsuite-gateway

Set<String> imports = new HashSet<>();
FunctionBlock fb = fbp.getType().getFunctionblock();
for (Entity entity : Utils.getReferencedEntities(fb)) {
 if (!visited.contains(entity)) {
  generateForEntity(ctx, entity, zipOutputter);
 exports.add(entity.getNamespace());
for (Enum en : Utils.getReferencedEnums(fb)) {
 if (!visited.contains(en)) {
  generateForEnum(ctx, en, zipOutputter);

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap

_builder.newLine();
_builder.append("private ");
String _propertyType = Utils.getPropertyType(property);
_builder.append(_propertyType, "");
_builder.append(" ");
 boolean _isReadable = Utils.isReadable(property);
 if (_isReadable) {
   if ((_type instanceof ObjectPropertyType)) {
    _builder.append("public ");
    String _propertyType_1 = Utils.getPropertyType(property);
    _builder.append(_propertyType_1, "");
    _builder.append(" get");
   } else {
    _builder.append("public ");
    String _propertyType_2 = Utils.getPropertyType(property);
    _builder.append(_propertyType_2, "");
    _builder.append(" get");
 boolean _isWritable = Utils.isWritable(property);
 if (_isWritable) {
  _builder.append("public void set");
  _builder.append(_firstUpper_2, "");
  _builder.append("(");
  String _propertyType_3 = Utils.getPropertyType(property);
  _builder.append(_propertyType_3, "");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap

_builder.newLine();
 boolean _isReadable = Utils.isReadable(property);
 if (_isReadable) {
  _builder.append("\t");
 boolean _isWritable = Utils.isWritable(property);
 if (_isWritable) {
  _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap

private String getResourceConfiguration(final Property property) {
  String readable = "false";
  String writeable = "false";
  String eventable = "false";
  String result = "new Resource.Configuration(";
  boolean _isReadable = Utils.isReadable(property);
  if (_isReadable) {
   readable = "GET";
  }
  boolean _isWritable = Utils.isWritable(property);
  if (_isWritable) {
   writeable = "PUT";
  }
  boolean _isEventable = Utils.isEventable(property);
  if (_isEventable) {
   eventable = "OBSERVE";
  }
  return ((((((result + readable) + ", ") + writeable) + ", false, false, false, ") + eventable) + ")");
 }
}

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.aws

/**
 * Generates Alexa Custom Slot Types for every Infomodel Enumeration
 */
public void generateCustomSlotTypes(final InformationModel infomodel, final InvocationContext context, final IGeneratedWriter output) {
 EList<FunctionblockProperty> _properties = infomodel.getProperties();
 for (final FunctionblockProperty fbModel : _properties) {
  {
   FunctionblockModel _type = fbModel.getType();
   FunctionBlock _functionblock = _type.getFunctionblock();
   EList<org.eclipse.vorto.core.api.model.datatype.Enum> enums = Utils.getReferencedEnums(_functionblock);
   for (final org.eclipse.vorto.core.api.model.datatype.Enum enumeration : enums) {
    {
     AlexaSlotTypeTemplate _alexaSlotTypeTemplate = new AlexaSlotTypeTemplate();
     GeneratorTaskFromFileTemplate<org.eclipse.vorto.core.api.model.datatype.Enum> _template = new GeneratorTaskFromFileTemplate<org.eclipse.vorto.core.api.model.datatype.Enum>(_alexaSlotTypeTemplate);
     _template.generate(enumeration, context, output);
    }
   }
  }
 }
}

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex

EList<Entity> _referencedEntities = Utils.getReferencedEntities(_functionblock);
for(final Entity type : _referencedEntities) {
 _builder.append("\t");

代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.javabean

public IGenerationResult generate(InformationModel infomodel, InvocationContext invocationContext,
    IVortoCodeGenProgressMonitor monitor) throws VortoCodeGeneratorException {
  
  GenerationResultZip zipOutputter = new GenerationResultZip(infomodel,getServiceKey());
  
  for (FunctionblockProperty fbp : infomodel.getProperties()) {
    this.generateForFunctionBlock(infomodel, fbp.getType(), zipOutputter);
    FunctionBlock fb = fbp.getType().getFunctionblock();
    for (Entity entity : Utils.getReferencedEntities(fb)) {
      generateForEntity(infomodel, entity, zipOutputter);
    }
    for (Enum en : Utils.getReferencedEnums(fb)) {
      generateForEnum(infomodel, en, zipOutputter);
    }
  }
  
  new GeneratorTaskFromFileTemplate<InformationModel>(new PomFileTemplate()).generate(infomodel, invocationContext,zipOutputter);
  
  return zipOutputter;
}

相关文章