protected static Set<Structure> getContainmentReferencePropertyTypes(Structure type) { Set<Structure> result = Sets.newHashSet(); for (ReferenceProperty prop : filter(type.getReferenceProperties(), isContainmentReferenceProperty())) { result.add(prop.getType()); } return result; }
IScope scope_ReferenceProperty_inverse(final ReferenceProperty referenceProperty, EReference eRef) { final Structure containerType = referenceProperty.getContainingDataType(); Structure referencedType = referenceProperty.getType(); if (referencedType != null) { Iterable<ReferenceProperty> result = referencedType.getReferenceProperties(); result = Iterables.filter(result, new Predicate<ReferenceProperty>() { @Override public boolean apply(ReferenceProperty inverseReference) { return (inverseReference != referenceProperty) && (inverseReference.getType() == containerType); } }); return Scopes.scopeFor(result); } return null; }
public EList<ReferenceTreatment> buildReferenceTreatmentsList(final EffectiveRealization realization) { final ArrayList<ReferenceTreatment> referenceTreatments = new ArrayList<ReferenceTreatment>(); final Function1<ReferenceProperty, Boolean> _function = (ReferenceProperty it) -> { return Boolean.valueOf(realization.getReferenceRealizations().containsKey(it.getName())); }; final Function1<ReferenceProperty, ReferenceTreatment> _function_1 = (ReferenceProperty refProperty) -> { final EffectiveRealization refRealization = realization.getReferenceRealizations().get(refProperty.getName()); final ReferenceRealization referenceRealization = refRealization.asReferenceRealization(); final ReferenceTreatment referenceTreatment = this.buildReferenceTreatment(referenceRealization); referenceTreatment.setReferenceElement(refProperty); return referenceTreatment; }; final Consumer<ReferenceTreatment> _function_2 = (ReferenceTreatment it) -> { referenceTreatments.add(it); }; IterableExtensions.<ReferenceProperty, ReferenceTreatment>map(IterableExtensions.<ReferenceProperty>filter(realization.getType().getReferenceProperties(), _function), _function_1).forEach(_function_2); return ECollections.<ReferenceTreatment>unmodifiableEList(referenceTreatments); }
private JsonNode createStructureMetadata(Structure struct) { ObjectNode root = newObjectNode(); root.put("name", struct.getName()); ObjectNode fields = root.putObject("fields"); for (PrimitiveProperty prop : struct.getPrimitiveProperties()) { ObjectNode field = fields.putObject(prop.getName()); field.put("name", prop.getName()); field.put("type", prop.getPrimitiveType().getName()); field.put("multi", prop.getMaxOccurs() < 0); } for (ReferenceProperty prop : struct.getReferenceProperties()) { ObjectNode field = fields.putObject(prop.getName()); field.put("name", prop.getName()); field.put("type", "ref"); field.put("multi", prop.getMaxOccurs() < 0); field.put("refType", getRefTypeName(prop)); } return root; }
if (realizationContainer.getActualType() != null) { Structure type = realizationContainer.getActualType(); Stream<ReferenceProperty> implicitReferenceTreatments = type.getReferenceProperties().stream() // .filter(isIncluded(realizationContainer.getProperties()).and(isNotDefined(realizationContainer)));
for (ReferenceProperty prop : ((Structure) s).getReferenceProperties()) { ObjectNode propNode = fieldRoot.putObject(prop.getName()); if (refFieldSkeleton != null) {