本文整理了Java中com.reprezen.rapidml.xtext.util.ZenModelHelper
类的一些代码示例,展示了ZenModelHelper
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZenModelHelper
类的具体详情如下:
包路径:com.reprezen.rapidml.xtext.util.ZenModelHelper
类名称:ZenModelHelper
暂无
代码示例来源:origin: com.reprezen.genflow/genflow-api
public static List<SingleValueType> getUsedSimpleTypes(ResourceAPI resourceAPI) {
List<SingleValueType> types = new LinkedList<>();
ZenModelHelper helper = new ZenModelHelper();
types.addAll(helper.getUsedEnums(resourceAPI));
types.addAll(helper.getUsedUserDefinedTypes(resourceAPI));
return types;
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected List<?> getReferenceTreatmentIncludedProperties(final ReferenceTreatment refEmbed) {
if (refEmbed instanceof ReferenceEmbed) {
return _getReferenceTreatmentIncludedProperties((ReferenceEmbed)refEmbed);
} else if (refEmbed instanceof ReferenceLink) {
return _getReferenceTreatmentIncludedProperties((ReferenceLink)refEmbed);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(refEmbed).toString());
}
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
public Collection<Enumeration> getUsedEnums(final Object resource) {
if (resource instanceof ServiceDataResource) {
return _getUsedEnums((ServiceDataResource)resource);
} else if (resource instanceof PrimitiveProperty) {
return _getUsedEnums((PrimitiveProperty)resource);
} else if (resource instanceof ReferenceProperty) {
return _getUsedEnums((ReferenceProperty)resource);
} else if (resource instanceof ResourceAPI) {
return _getUsedEnums((ResourceAPI)resource);
} else if (resource instanceof ReferenceTreatment) {
return _getUsedEnums((ReferenceTreatment)resource);
} else if (resource instanceof ZenModel) {
return _getUsedEnums((ZenModel)resource);
} else if (resource != null) {
return _getUsedEnums(resource);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(resource).toString());
}
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<Enumeration> _getUsedEnums(final ReferenceTreatment ref) {
final Function1<Object, Collection<Enumeration>> _function = (Object it) -> {
return this.getUsedEnums(it);
};
return IterableExtensions.<Enumeration>toSet(Iterables.<Enumeration>concat(ListExtensions.map(this.getReferenceTreatmentIncludedProperties(ref), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<UserDefinedType> _getUsedUserDefinedTypes(final ReferenceTreatment ref) {
final Function1<Object, Collection<UserDefinedType>> _function = (Object it) -> {
return this.getUsedUserDefinedTypes(it);
};
return IterableExtensions.<UserDefinedType>toSet(Iterables.<UserDefinedType>concat(ListExtensions.map(this.getReferenceTreatmentIncludedProperties(ref), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<UserDefinedType> _getUsedUserDefinedTypes(final ServiceDataResource resource) {
final Function1<PropertyRealization, Boolean> _function = (PropertyRealization e) -> {
boolean _hasReferenceTreatment = this.hasReferenceTreatment(resource, e.getBaseProperty());
return Boolean.valueOf((!_hasReferenceTreatment));
};
final Function1<PropertyRealization, Collection<UserDefinedType>> _function_1 = (PropertyRealization it) -> {
return this.getUsedUserDefinedTypes(it.getBaseProperty());
};
Iterable<UserDefinedType> _flatten = Iterables.<UserDefinedType>concat(IterableExtensions.<PropertyRealization, Collection<UserDefinedType>>map(IterableExtensions.<PropertyRealization>filter(resource.getIncludedProperties(), _function), _function_1));
final Function1<ReferenceEmbed, Collection<UserDefinedType>> _function_2 = (ReferenceEmbed it) -> {
return this.getUsedUserDefinedTypes(it);
};
Iterable<UserDefinedType> _flatten_1 = Iterables.<UserDefinedType>concat(IterableExtensions.<ReferenceEmbed, Collection<UserDefinedType>>map(Iterables.<ReferenceEmbed>filter(resource.getReferenceTreatments(), ReferenceEmbed.class), _function_2));
return IterableExtensions.<UserDefinedType>toSet(Iterables.<UserDefinedType>concat(_flatten, _flatten_1));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<Enumeration> _getUsedEnums(final ServiceDataResource resource) {
final Function1<PropertyRealization, Boolean> _function = (PropertyRealization e) -> {
boolean _hasReferenceTreatment = this.hasReferenceTreatment(resource, e.getBaseProperty());
return Boolean.valueOf((!_hasReferenceTreatment));
};
final Function1<PropertyRealization, Collection<Enumeration>> _function_1 = (PropertyRealization it) -> {
return this.getUsedEnums(it.getBaseProperty());
};
Iterable<Enumeration> _flatten = Iterables.<Enumeration>concat(IterableExtensions.<PropertyRealization, Collection<Enumeration>>map(IterableExtensions.<PropertyRealization>filter(resource.getIncludedProperties(), _function), _function_1));
final Function1<ReferenceEmbed, Collection<Enumeration>> _function_2 = (ReferenceEmbed it) -> {
return this.getUsedEnums(it);
};
Iterable<Enumeration> _flatten_1 = Iterables.<Enumeration>concat(IterableExtensions.<ReferenceEmbed, Collection<Enumeration>>map(Iterables.<ReferenceEmbed>filter(resource.getReferenceTreatments(), ReferenceEmbed.class), _function_2));
return IterableExtensions.<Enumeration>toSet(Iterables.<Enumeration>concat(_flatten, _flatten_1));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<Enumeration> _getUsedEnums(final ResourceAPI resourceAPI) {
final Function1<ServiceDataResource, Collection<Enumeration>> _function = (ServiceDataResource dataInterface) -> {
return this.getUsedEnums(dataInterface);
};
return IterableExtensions.<Enumeration>toSet(Iterables.<Enumeration>concat(IterableExtensions.<ServiceDataResource, Collection<Enumeration>>map(Iterables.<ServiceDataResource>filter(resourceAPI.getOwnedResourceDefinitions(), ServiceDataResource.class), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<UserDefinedType> _getUsedUserDefinedTypes(final ResourceAPI resourceAPI) {
final Function1<ServiceDataResource, Collection<UserDefinedType>> _function = (ServiceDataResource dataInterface) -> {
return this.getUsedUserDefinedTypes(dataInterface);
};
return IterableExtensions.<UserDefinedType>toSet(Iterables.<UserDefinedType>concat(IterableExtensions.<ServiceDataResource, Collection<UserDefinedType>>map(Iterables.<ServiceDataResource>filter(resourceAPI.getOwnedResourceDefinitions(), ServiceDataResource.class), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected List<?> _getReferenceTreatmentIncludedProperties(final ReferenceLink refEmbed) {
return this.getIncludedPrimitiveProperties(refEmbed);
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
public Collection<UserDefinedType> getUsedUserDefinedTypes(final Object resource) {
if (resource instanceof ServiceDataResource) {
return _getUsedUserDefinedTypes((ServiceDataResource)resource);
} else if (resource instanceof PrimitiveProperty) {
return _getUsedUserDefinedTypes((PrimitiveProperty)resource);
} else if (resource instanceof ReferenceProperty) {
return _getUsedUserDefinedTypes((ReferenceProperty)resource);
} else if (resource instanceof ResourceAPI) {
return _getUsedUserDefinedTypes((ResourceAPI)resource);
} else if (resource instanceof ReferenceTreatment) {
return _getUsedUserDefinedTypes((ReferenceTreatment)resource);
} else if (resource instanceof ZenModel) {
return _getUsedUserDefinedTypes((ZenModel)resource);
} else if (resource != null) {
return _getUsedUserDefinedTypes(resource);
} else {
throw new IllegalArgumentException("Unhandled parameter types: " +
Arrays.<Object>asList(resource).toString());
}
}
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
public List<Feature> getIncludedPrimitiveProperties(final ReferenceTreatment refTreatment) {
final Function1<Feature, Boolean> _function = (Feature e) -> {
return Boolean.valueOf((e instanceof PrimitiveProperty));
};
return IterableExtensions.<Feature>toList(IterableExtensions.<Feature>filter(this.getIncludedProperties(refTreatment), _function));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<Enumeration> _getUsedEnums(final ZenModel model) {
final Function1<ResourceAPI, Collection<Enumeration>> _function = (ResourceAPI it) -> {
return this.getUsedEnums(it);
};
return IterableExtensions.<Enumeration>toSet(Iterables.<Enumeration>concat(ListExtensions.<ResourceAPI, Collection<Enumeration>>map(model.getResourceAPIs(), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected Collection<UserDefinedType> _getUsedUserDefinedTypes(final ZenModel model) {
final Function1<ResourceAPI, Collection<UserDefinedType>> _function = (ResourceAPI it) -> {
return this.getUsedUserDefinedTypes(it);
};
return IterableExtensions.<UserDefinedType>toSet(Iterables.<UserDefinedType>concat(ListExtensions.<ResourceAPI, Collection<UserDefinedType>>map(model.getResourceAPIs(), _function)));
}
代码示例来源:origin: com.reprezen.rapidml/com.reprezen.rapidml
protected List<?> _getReferenceTreatmentIncludedProperties(final ReferenceEmbed refEmbed) {
final ArrayList<EObject> includedProps = new ArrayList<EObject>();
includedProps.addAll(this.getIncludedPrimitiveProperties(refEmbed));
includedProps.addAll(refEmbed.getNestedReferenceTreatments());
return includedProps;
}
代码示例来源:origin: com.reprezen.genflow/genflow-api
public static List<SingleValueType> getUsedSimpleTypes(ZenModel zenModel) {
List<SingleValueType> types = new LinkedList<>();
ZenModelHelper helper = new ZenModelHelper();
Iterables.addAll(types, helper.getUsedEnums(zenModel));
Iterables.addAll(types, helper.getUsedUserDefinedTypes(zenModel));
return types;
}
内容来源于网络,如有侵权,请联系作者删除!