Merge remote-tracking branch 'origin/master' into neon
diff --git a/plugins/contracts/org.polarsys.chess.contracts.profile/src/org/polarsys/chess/contracts/profile/chesscontract/util/EntityUtil.java b/plugins/contracts/org.polarsys.chess.contracts.profile/src/org/polarsys/chess/contracts/profile/chesscontract/util/EntityUtil.java
index f79e68a..0e0066a 100644
--- a/plugins/contracts/org.polarsys.chess.contracts.profile/src/org/polarsys/chess/contracts/profile/chesscontract/util/EntityUtil.java
+++ b/plugins/contracts/org.polarsys.chess.contracts.profile/src/org/polarsys/chess/contracts/profile/chesscontract/util/EntityUtil.java
@@ -4033,6 +4033,14 @@
 		return null;
 	}
 
+	/**
+	 * Returns the first operation found with the given name.
+	 * <br>
+	 * This is a very trivial method, no additional checks are done.
+	 * @param operationName the name of the Operation
+	 * @param block the owner class
+	 * @return the Operation
+	 */
 	public Operation getOperation(String operationName, Class block) {
 		return block.getOwnedOperation(operationName, null, null);
 		// logger.debug("getOperationType: " + block + " , " + operationName);
@@ -4046,6 +4054,18 @@
 		// return null;
 	}
 
+	/**
+	 * Returns the first property found with the given name.
+	 * <br>
+	 * This is a very trivial method, no additional checks are done.
+	 * @param propertyName the name of the Property
+	 * @param block the owner class
+	 * @return the Property
+	 */
+	public Property getProperty(String propertyName, Class block) {
+		return block.getOwnedAttribute(propertyName, null);
+	}
+	
 	public boolean isAttribute(String attributeName, Class blockAsClass) {
 		if (blockAsClass != null) {
 			Property umlProperty = blockAsClass.getOwnedAttribute(attributeName, null);
@@ -4316,5 +4336,43 @@
 		return result;
 	}
 	
+	/**
+	 * Returns true if the visibility of the given element is private.
+	 * @param e the NamedElement
+	 * @return
+	 * @throws Exception in case no visibility is set
+	 */
+	public boolean isVisibilityPrivate(NamedElement e) throws Exception {
+		if (e.isSetVisibility()) {
+			return (e.getVisibility() == VisibilityKind.PRIVATE_LITERAL);
+		}
+		throw new Exception("Element does not have any visibility");
+	}
+
+	/**
+	 * Returns true if the visibility of the given element is priprotected.
+	 * @param e the NamedElement
+	 * @return
+	 * @throws Exception in case no visibility is set
+	 */
+	public boolean isVisibilityProtected(NamedElement e) throws Exception {
+		if (e.isSetVisibility()) {
+			return (e.getVisibility() == VisibilityKind.PROTECTED_LITERAL);
+		}
+		throw new Exception("Element does not have any visibility");
+	}
+
+	/**
+	 * Returns true if the visibility of the given element is public.
+	 * @param e the NamedElement
+	 * @return
+	 * @throws Exception in case no visibility is set
+	 */
+	public boolean isVisibilityPublic(NamedElement e) throws Exception {
+		if (e.isSetVisibility()) {
+			return (e.getVisibility() == VisibilityKind.PUBLIC_LITERAL);
+		}
+		throw new Exception("Element does not have any visibility");
+	}
 
 }
\ No newline at end of file