From 3a79b751946d3df29a865da451c32b3bd51ba486 Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Wed, 6 Apr 2011 12:17:52 +0000 Subject: [PATCH] minor: improved examples in javadoc SVN: 20670 --- .../shared/api/v1/dto/SearchCriteria.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SearchCriteria.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SearchCriteria.java index 4a6687c6a80..6150ac9b500 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SearchCriteria.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/api/v1/dto/SearchCriteria.java @@ -28,15 +28,19 @@ import org.apache.commons.lang.builder.ToStringStyle; /** * A (mutable) object representing the specification of a search. A search is specified by - * MatchClause objects and an operator for combining match clauses. + * MatchClause objects and an operator for combining match clauses. Additionally sub criteria can be + * added for entities connected with the main entity object. * <p> * A MatchClause is made up of a property or attribute to compare against and a desired value for * that property or attribute. * <p> * Example:<br> - * <blockquote> Match all of the following clauses: <blockquote> Attribute('TYPE') = [desired value] - * <br> - * Property('PROPERTY_CODE') = [desired value] </blockquote> </blockquote> + * <blockquote> Match all of the following clauses: + * <ul> + * <li>Attribute('TYPE') = [desired value] + * <li>Property('PROPERTY_CODE') = [desired value] + * </ul> + * </blockquote> * <p> * Looks like this:<br> * <blockquote><code> @@ -44,7 +48,17 @@ import org.apache.commons.lang.builder.ToStringStyle; sc.addMatchClause(MatchClause.createAttributeMatch(MatchClauseAttribute.TYPE, "A_TYPE_CODE"));<br> sc.addMatchClause(MatchClause.createPropertyMatch("PROPERTY_CODE", "a property value"));<br> * </code></blockquote> + * <p> + * Extension of the previous example with with experiment criteria:<br> + * <blockquote><code> + SearchCriteria ec = new SearchCriteria();<br> + ec.addMatchClause(MatchClause.createAttributeMatch(MatchClauseAttribute.CODE, "EXP_CODE"));<br> + sc.addSubCriteria(SearchSubCriteria.createExperimentCriteria(ec));<br> + * </code> </blockquote> + * <p> + * For other sub criteria types see {@link SearchSubCriteria}. * + * @see SearchSubCriteria * @author Chandrasekhar Ramakrishnan */ public class SearchCriteria implements Serializable -- GitLab