@Override public boolean apply(ReferenceProperty inverseReference) { return (inverseReference != referenceProperty) && (inverseReference.getType() == containerType); } });
@Override public Structure getStructure() { return this.refProp.getType(); }
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; }
public boolean checkAutoLinkableToObject(final ReferenceProperty prop, final Boolean autoLinkable) { if ((autoLinkable == null)) { return true; } boolean _isAutoLinkableToObjectResource = ContextMatcher.isAutoLinkableToObjectResource(prop.getType(), this.context.getApi()); return ((autoLinkable).booleanValue() == _isAutoLinkableToObjectResource); }
public boolean checkAutoLinkableToCollection(final ReferenceProperty prop, final Boolean autoLinkable) { if ((autoLinkable == null)) { return true; } boolean _isAutoLinkableToCollectionResource = ContextMatcher.isAutoLinkableToCollectionResource(prop.getType(), this.context.getApi()); return ((autoLinkable).booleanValue() == _isAutoLinkableToCollectionResource); } }
public boolean checkHasKeys(final ReferenceProperty prop, final Boolean hasKeys) { return ((hasKeys == null) || ((hasKeys).booleanValue() == IterableExtensions.<Feature>exists(prop.getType().getOwnedFeatures(), ((Function1<Feature, Boolean>) (Feature it) -> { return Boolean.valueOf(it.isKey()); })))); }
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; }
private void checkReferencePropertyRestrictionType(ReferenceProperty validatedProperty, Feature overriddenProperty) { Structure restrictionType = validatedProperty.getType(); if (overriddenProperty instanceof ReferenceProperty) { Structure overriddenType = ((ReferenceProperty) overriddenProperty).getType(); if (overriddenType == restrictionType) {// same type return; } if (restrictionType.getAllSupertypes().contains(overriddenType)) {// covariance return; } String message = String.format( "The type of property '%s' is incompatible with inherited property type: '%s'", validatedProperty.getName(), overriddenType.getName()); error(message, validatedProperty, RapidmlPackage.Literals.REFERENCE_PROPERTY__TYPE); } }
@Check public void checkCircularContainment(ReferenceProperty referenceProperty) { if (referenceProperty.isContainment()) { Structure contained = referenceProperty.getType(); checkCircularContainment(Sets.newHashSet(referenceProperty.getContainingDataType()), contained); } }
private String getRefTypeName(ReferenceProperty prop) { DataModel thisDataModel = (DataModel) prop.getContainingDataType().eContainer(); ZenModel thisModel = (ZenModel) thisDataModel.eContainer(); Structure refType = prop.getType(); DataModel refDataModel = (DataModel) refType.eContainer(); ZenModel refModel = (ZenModel) refDataModel.eContainer(); if (thisDataModel == refDataModel) { return refType.getName(); } else if (thisModel == refModel) { return String.format("%s.%s", refDataModel.getName(), refType.getName()); } else { return String.format("%s.%s.%s", refModel.getName(), refDataModel.getName(), refType.getName()); } }
ReferenceProperty inheritedReferenceProperty = (ReferenceProperty) inheritedProperty; ReferenceProperty newReferenceProperty = RapidmlFactory.eINSTANCE.createReferenceProperty(); newReferenceProperty.setType(inheritedReferenceProperty.getType()); newReferenceProperty.setContainer(inheritedReferenceProperty.isContainer()); newReferenceProperty.setContainment(inheritedReferenceProperty.isContainment());
String _htmlLink = this.docHelper.htmlLink(property.getType()); _builder.append(_htmlLink); _builder.append("\">"); if (_tripleNotEquals) { _builder.append("<br> inverse of <a href=\"#"); String _htmlLink_1 = this.docHelper.htmlLink(property.getType()); _builder.append(_htmlLink_1); _builder.append("\">");
_builder.append(" "); _builder.append("\"type\": \""); String _name_1 = feature.getType().getName(); _builder.append(_name_1, " "); _builder.append("\",");
_builder.append(" "); _builder.append("<a href=\"#"); String _htmlLink = this.docHelper.htmlLink(((ReferenceProperty) property).getType()); _builder.append(_htmlLink, " "); _builder.append("\">");
_builder.append("<a href=\"#"); Feature _baseProperty_1 = includedProperty.getBaseProperty(); String _htmlLink = this.docHelper.htmlLink(((ReferenceProperty) _baseProperty_1).getType()); _builder.append(_htmlLink, " "); _builder.append("\">");