KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > rule > RuleImpl


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.rule;
18
19 import java.io.Serializable JavaDoc;
20
21 import org.alfresco.repo.action.CompositeActionImpl;
22 import org.alfresco.service.cmr.repository.NodeRef;
23 import org.alfresco.service.cmr.rule.Rule;
24 import org.alfresco.util.ParameterCheck;
25
26 /**
27  * Rule implementation class.
28  * <p>
29  * Encapsulates all the information about a rule. Can be creted or editied and
30  * then passed to the rule service to create/update a rule instance.
31  *
32  * @author Roy Wetherall
33  */

34 public class RuleImpl extends CompositeActionImpl implements Serializable JavaDoc, Rule
35 {
36     /**
37      * Serial version UID
38      */

39     private static final long serialVersionUID = 3544385898889097524L;
40
41     /**
42      * The rule type name
43      */

44     private String JavaDoc ruleTypeName;
45     
46     /**
47      * Indicates whether the rule is applied to all the children of the associated node
48      * rather than just the node itself.
49      */

50     private boolean isAppliedToChildren = false;
51     
52     /**
53      * Constructor
54      *
55      * @param ruleTypeName the rule type name
56      */

57     public RuleImpl(String JavaDoc id, String JavaDoc ruleTypeName, NodeRef owningNodeRef)
58     {
59         super(id, owningNodeRef);
60         ParameterCheck.mandatory("ruleTypeName", ruleTypeName);
61         
62         this.ruleTypeName = ruleTypeName;
63     }
64     
65     /**
66      * @see org.alfresco.service.cmr.rule.Rule#isAppliedToChildren()
67      */

68     public boolean isAppliedToChildren()
69     {
70         return this.isAppliedToChildren;
71     }
72     
73     /**
74      *@see org.alfresco.service.cmr.rule.Rule#applyToChildren(boolean)
75      */

76     public void applyToChildren(boolean isAppliedToChildren)
77     {
78         this.isAppliedToChildren = isAppliedToChildren;
79     }
80     
81     /**
82      * @see org.alfresco.service.cmr.rule.Rule#getRuleTypeName()
83      */

84     public String JavaDoc getRuleTypeName()
85     {
86         return this.ruleTypeName;
87     }
88 }
89
90
Popular Tags