View Javadoc

1   /*
2    * Copyright 2000-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.jetspeed.om.profile.psml;
18  
19  // Jetspeed imports
20  import org.apache.jetspeed.om.SecurityReference;
21  import org.apache.jetspeed.om.profile.*;
22  
23  /***
24   * Default bean like implementation of the Entry interface
25   * suitable for serialization with Castor
26   * 
27   * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
28   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
29   * @version $Id: PsmlEntry.java,v 1.6 2004/02/23 03:02:54 jford Exp $
30   */
31  public class PsmlEntry extends PsmlIdentityElement implements Entry
32  {
33  
34      private String parent = null;
35  
36      /*** Holds value of property securityRef. */
37      private SecurityReference securityRef;    
38      
39      /*** @return the entry name from which this one is derived */
40      public String getParent()
41      {
42          return this.parent;
43      }
44                                  
45      /***
46       * Sets the ancestor for this Entry.
47       * @param parent the new ancestor entry name. This name should
48       * be defined in the system registry
49       */
50      public void setParent( String parent )
51      {
52          this.parent = parent;
53      }
54               
55      /*** Getter for property securityRef.
56       * @return Value of property securityRef.
57       */
58      public SecurityReference getSecurityRef()
59      {
60          return securityRef;
61      }    
62  
63      /*** Setter for property securityRef.
64       * @param securityRef New value of property securityRef.
65       */
66      public void setSecurityRef(SecurityReference securityRef)
67      {
68          this.securityRef = securityRef;
69      }
70      
71      /*** This method recreates the paramter name index for quick retrieval
72       *  of parameters by name. Shoule be called whenever a complete index
73       *  of parameter should be rebuilt (eg removing a parameter or setting 
74       *  a parameters vector)
75      private void buildNameIndex()
76      {
77          Hashtable idx = new Hashtable();
78          
79          Iterator i = parameter.iterator();
80          int count = 0;
81          while( i.hasNext() )
82          {
83              Parameter p = (Parameter)i.next();
84              idx.put( p.getName(), new Integer(count) );
85              count++;
86          }
87          
88          this.nameIdx = idx;
89      }            
90       */
91  
92      /***
93       * Create a clone of this object
94       */
95      public Object clone()
96          throws java.lang.CloneNotSupportedException
97      {
98          Object cloned = super.clone();
99  
100         // clone the securityRef
101         ((PsmlEntry)cloned).securityRef = ((this.securityRef == null) ? null : (SecurityReference) this.securityRef.clone());
102 
103         return cloned;
104 
105     }   // clone
106 }
107