本文整理了Java中org.eclipse.vorto.core.api.model.datatype.Property.getType()
方法的一些代码示例,展示了Property.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getType()
方法的具体详情如下:
包路径:org.eclipse.vorto.core.api.model.datatype.Property
类名称:Property
方法名:getType
[英]Returns the value of the 'Type' containment reference.
If the meaning of the 'Type' containment reference isn't clear, there really should be more of a description here...
[中]返回“Type”包含引用的值。
如果“Type”包含引用的含义不清楚,这里真的应该有更多的描述。。。
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.thingworx
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";
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.editor.datatype
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;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen
public static String getPropertyType(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.getName();
} else {
PropertyType _type_3 = property.getType();
if ((_type_3 instanceof ObjectPropertyType)) {
PropertyType _type_4 = property.getType();
Type _type_5 = ((ObjectPropertyType) _type_4).getType();
return _type_5.getName();
}
}
return null;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap
private void generateForProperty(Property property, IGeneratedWriter outputter) {
if(property.getType() != null && property.getType() instanceof PrimitivePropertyType){
new JavaFBPropertyPrimitiveParamWrapperGeneratorTask(
property.getName() + COAP_PRIM_TYPE_WRAPPER_SUFFIX,
JAVA_FILE_EXTENSION,
primitiveTypeWrapperTargetPath,
PRIMITIVE_TYPE_WRAPPER_PACKAGE)
.generate(property, null, outputter);
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap
private void generateForProperty(Property property, IGeneratedWriter outputter) {
if(property.getType() != null && property.getType() instanceof PrimitivePropertyType){
new JavaFBPropertyPrimitiveParamWrapperGeneratorTask(
property.getName() + COAP_PRIM_TYPE_WRAPPER_SUFFIX,
JAVA_FILE_EXTENSION,
primitiveTypeWrapperTargetPath,
PRIMITIVE_TYPE_WRAPPER_PACKAGE)
.generate(property, null, outputter);
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen
public static boolean isSimpleNumeric(final Property property) {
PropertyType _type = property.getType();
if ((_type instanceof PrimitivePropertyType)) {
PropertyType _type_1 = property.getType();
PrimitiveType primitiveType = ((PrimitivePropertyType) _type_1).getType();
boolean _equals = Objects.equal(primitiveType, PrimitiveType.INT);
代码示例来源:origin: org.eclipse.vorto/boschiotsuite-gateway
public static EList<Type> getReferencedTypes(Property property) {
EList<Type> types = new BasicEList<Type>();
if (property.getType() instanceof ObjectPropertyType) {
ObjectPropertyType objectType = (ObjectPropertyType) property.getType();
types.add(objectType.getType());
if (objectType.getType() instanceof Entity) {
types.addAll(getReferencedTypes((Entity) objectType.getType()));
}
}
return types;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.prosystfi
public static EList<Type> getReferencedTypes(Property property) {
EList<Type> types = new BasicEList<Type>();
if (property.getType() instanceof ObjectPropertyType) {
ObjectPropertyType objectType = (ObjectPropertyType)property.getType();
types.add(objectType.getType());
if (objectType.getType() instanceof Entity) {
types.addAll(getReferencedTypes((Entity)objectType.getType()));
}
}
return types;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino
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 + ")");
}
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.webui
public CharSequence writeStatusProperty(final FunctionblockModel fbModel, final Property prop, final String propertyValueAccessor) {
PropertyType _type = prop.getType();
if ((_type instanceof ObjectPropertyType)) {
PropertyType _type_1 = prop.getType();
ObjectPropertyType objectPropertyType = ((ObjectPropertyType) _type_1);
Type _type_2 = objectPropertyType.getType();
EList<Property> _properties = entity.getProperties();
for (final Property _prop : _properties) {
PropertyType _type_4 = _prop.getType();
if ((_type_4 instanceof ObjectPropertyType)) {
String _name = _prop.getName();
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.webdevice
public CharSequence writeStatusProperty(final FunctionblockModel fbModel, final Property prop, final String propertyValueAccessor) {
PropertyType _type = prop.getType();
if ((_type instanceof ObjectPropertyType)) {
PropertyType _type_1 = prop.getType();
ObjectPropertyType objectPropertyType = ((ObjectPropertyType) _type_1);
Type _type_2 = objectPropertyType.getType();
EList<Property> _properties = entity.getProperties();
for (final Property _prop : _properties) {
PropertyType _type_4 = _prop.getType();
if ((_type_4 instanceof ObjectPropertyType)) {
String _name = _prop.getName();
代码示例来源:origin: eclipse/vorto
private static List<Property> getFlatProperties(FunctionblockModel fbm) {
List<Property> properties = new ArrayList<Property>();
TreeIterator<EObject> iter = fbm.eAllContents();
while (iter.hasNext()) {
EObject obj = iter.next();
if (obj instanceof Property) {
Property property = (Property) obj;
properties.add(property);
if (property.getType() instanceof ObjectPropertyType) {
ObjectPropertyType objectType = (ObjectPropertyType) property.getType();
if (objectType.getType() instanceof Entity) { // only flatten entities
Entity entity = (Entity) ((ObjectPropertyType) property.getType()).getType();
List<Property> entityProperties = getFlatProperties(entity);
entity.getProperties().addAll(entityProperties);
if (entity.getSuperType() != null) {
removeSuperTypeModelReference(entity);
}
entity.getProperties().stream().filter(p -> p.getType() instanceof ObjectPropertyType)
.forEach(p -> createReference(entity, (ObjectPropertyType) p.getType()));
}
}
}
}
if (fbm.getSuperType() != null) {
properties.addAll(getFlatProperties(fbm.getSuperType()));
}
return properties;
}
代码示例来源:origin: eclipse/vorto
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;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.coap
PropertyType _type = property.getType();
if ((_type instanceof PrimitivePropertyType)) {
PropertyType _type_1 = property.getType();
PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType();
return ValueMapper.mapSimpleDatatype(((PrimitiveType) _type_2));
} else {
PropertyType _type_3 = property.getType();
if ((_type_3 instanceof ObjectPropertyType)) {
PropertyType _type_4 = property.getType();
ObjectPropertyType object = ((ObjectPropertyType) _type_4);
Type _type_5 = object.getType();
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.coap
PropertyType _type = property.getType();
if ((_type instanceof PrimitivePropertyType)) {
PropertyType _type_1 = property.getType();
PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType();
return ValueMapper.mapSimpleDatatype(((PrimitiveType) _type_2));
} else {
PropertyType _type_3 = property.getType();
if ((_type_3 instanceof ObjectPropertyType)) {
PropertyType _type_4 = property.getType();
ObjectPropertyType object = ((ObjectPropertyType) _type_4);
Type _type_5 = object.getType();
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen
public static EList<Type> getReferencedTypes(final Property property) {
BasicEList<Type> types = new BasicEList<Type>();
PropertyType _type = property.getType();
if ((_type instanceof ObjectPropertyType)) {
PropertyType _type_1 = property.getType();
ObjectPropertyType objectType = ((ObjectPropertyType) _type_1);
Type _type_2 = objectType.getType();
types.add(_type_2);
Type _type_3 = objectType.getType();
if ((_type_3 instanceof Entity)) {
Type _type_4 = objectType.getType();
EList<Type> _referencedTypes = Utils.getReferencedTypes(((Entity) _type_4));
types.addAll(_referencedTypes);
}
}
return types;
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.thingworx
PropertyType _type = currentStatusProperty.getType();
if ((_type instanceof PrimitivePropertyType)) {
String currentType = this.getPrimitivePropertyType(currentStatusProperty);
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.editor.datatype
@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);
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.lwm2m
final PropertyType type = property.getType();
if( type instanceof PrimitivePropertyTypeImpl ) {
final String primitiveTypeStr = ( (PrimitivePropertyTypeImpl) type ).getType().toString();
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.ios
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");
内容来源于网络,如有侵权,请联系作者删除!