/[classpath]/classpath/gnu/CORBA/DynAn/gnuDynValue.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/DynAn/gnuDynValue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by gnu_andrew, Tue Aug 16 16:22:36 2005 UTC revision 1.1.2.2 by gnu_andrew, Sat Sep 10 15:31:35 2005 UTC
# Line 42  import gnu.CORBA.Unexpected; Line 42  import gnu.CORBA.Unexpected;
42    
43  import org.omg.CORBA.Any;  import org.omg.CORBA.Any;
44  import org.omg.CORBA.BAD_PARAM;  import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.CompletionStatus;  
45  import org.omg.CORBA.MARSHAL;  import org.omg.CORBA.MARSHAL;
 import org.omg.CORBA.NO_IMPLEMENT;  
46  import org.omg.CORBA.ORB;  import org.omg.CORBA.ORB;
47  import org.omg.CORBA.TCKind;  import org.omg.CORBA.TCKind;
48  import org.omg.CORBA.TypeCode;  import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.TypeCodePackage.*;  
49  import org.omg.CORBA.VM_TRUNCATABLE;  import org.omg.CORBA.VM_TRUNCATABLE;
50  import org.omg.CORBA.portable.OutputStream;  import org.omg.CORBA.portable.OutputStream;
51  import org.omg.CORBA.portable.ValueFactory;  import org.omg.CORBA.portable.ValueFactory;
# Line 69  import java.io.Serializable; Line 66  import java.io.Serializable;
66   *   *
67   * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)   * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
68   */   */
69  public class gnuDynValue  public class gnuDynValue extends abstractRecord implements DynValue,
70    extends abstractRecord    Serializable
   implements DynValue, Serializable  
71  {  {
72    /**    /**
73     * Use serialVersionUID for interoperability.     * Use serialVersionUID for interoperability.
# Line 86  public class gnuDynValue Line 82  public class gnuDynValue
82    /**    /**
83     * Create an instance.     * Create an instance.
84     */     */
85    public gnuDynValue(TypeCode oType, TypeCode aType, gnuDynAnyFactory aFactory,    public gnuDynValue(TypeCode oType, TypeCode aType,
86                       ORB anOrb      gnuDynAnyFactory aFactory, ORB anOrb
87                      )    )
88    {    {
89      super(oType, aType, aFactory, anOrb);      super(oType, aType, aFactory, anOrb);
90    
# Line 116  public class gnuDynValue Line 112  public class gnuDynValue
112                  // Add members of ancestor in front of the curren members.                  // Add members of ancestor in front of the curren members.
113                  DynValue anc = (DynValue) ancestor;                  DynValue anc = (DynValue) ancestor;
114                  anc.set_to_value();                  anc.set_to_value();
115    
116                  NameDynAnyPair[] aar = anc.get_members_as_dyn_any();                  NameDynAnyPair[] aar = anc.get_members_as_dyn_any();
117                  inheritFields(aar);                  inheritFields(aar);
118                }                }
# Line 128  public class gnuDynValue Line 125  public class gnuDynValue
125                }                }
126              else              else
127                throw new BAD_PARAM("The parent of " + final_type.id() + ", " +                throw new BAD_PARAM("The parent of " + final_type.id() + ", " +
128                                    parent.id() +                  parent.id() + ", is not structure nor value."
129                                    ", is not structure nor value."                );
                                  );  
130            }            }
131        }        }
132      catch (Exception e)      catch (Exception e)
# Line 168  public class gnuDynValue Line 164  public class gnuDynValue
164    }    }
165    
166    /** @inheritDoc */    /** @inheritDoc */
167    public TCKind current_member_kind()    public TCKind current_member_kind() throws TypeMismatch, InvalidValue
                              throws TypeMismatch, InvalidValue  
168    {    {
169      if (isNull)      if (isNull)
170        throw new TypeMismatch(ISNULL);        throw new TypeMismatch(ISNULL);
# Line 179  public class gnuDynValue Line 174  public class gnuDynValue
174    ;    ;
175    
176    /** @inheritDoc */    /** @inheritDoc */
177    public String current_member_name()    public String current_member_name() throws TypeMismatch, InvalidValue
                              throws TypeMismatch, InvalidValue  
178    {    {
179      if (isNull)      if (isNull)
180        throw new TypeMismatch(ISNULL);        throw new TypeMismatch(ISNULL);
# Line 190  public class gnuDynValue Line 184  public class gnuDynValue
184    ;    ;
185    
186    /** @inheritDoc */    /** @inheritDoc */
187    public NameDynAnyPair[] get_members_as_dyn_any()    public NameDynAnyPair[] get_members_as_dyn_any() throws InvalidValue
                                           throws InvalidValue  
188    {    {
189      if (isNull)      if (isNull)
190        throw new InvalidValue(ISNULL);        throw new InvalidValue(ISNULL);
# Line 200  public class gnuDynValue Line 193  public class gnuDynValue
193    ;    ;
194    
195    /** @inheritDoc */    /** @inheritDoc */
196    public NameValuePair[] get_members()    public NameValuePair[] get_members() throws InvalidValue
                               throws InvalidValue  
197    {    {
198      if (isNull)      if (isNull)
199        throw new InvalidValue(ISNULL);        throw new InvalidValue(ISNULL);
# Line 212  public class gnuDynValue Line 204  public class gnuDynValue
204    
205    /** @inheritDoc */    /** @inheritDoc */
206    public void set_members_as_dyn_any(NameDynAnyPair[] value)    public void set_members_as_dyn_any(NameDynAnyPair[] value)
207                                throws TypeMismatch, InvalidValue      throws TypeMismatch, InvalidValue
208    {    {
209      super.set_members_as_dyn_any(value);      super.set_members_as_dyn_any(value);
210      isNull = false;      isNull = false;
# Line 221  public class gnuDynValue Line 213  public class gnuDynValue
213    
214    /** @inheritDoc */    /** @inheritDoc */
215    public void set_members(NameValuePair[] value)    public void set_members(NameValuePair[] value)
216                     throws TypeMismatch, InvalidValue      throws TypeMismatch, InvalidValue
217    {    {
218      super.set_members(value);      super.set_members(value);
219      isNull = false;      isNull = false;
# Line 252  public class gnuDynValue Line 244  public class gnuDynValue
244     * Create a new instance.     * Create a new instance.
245     */     */
246    protected abstractRecord newInstance(TypeCode oType, TypeCode aType,    protected abstractRecord newInstance(TypeCode oType, TypeCode aType,
247                                         gnuDynAnyFactory aFactory, ORB anOrb      gnuDynAnyFactory aFactory, ORB anOrb
248                                        )    )
249    {    {
250      gnuDynValue v = new gnuDynValue(oType, aType, aFactory, anOrb);      gnuDynValue v = new gnuDynValue(oType, aType, aFactory, anOrb);
251      if (isNull)      if (isNull)
# Line 283  public class gnuDynValue Line 275  public class gnuDynValue
275    /**    /**
276     * Get the focused component, throwing exception if the current value is null.     * Get the focused component, throwing exception if the current value is null.
277     */     */
278    protected DynAny focused()    protected DynAny focused() throws InvalidValue, TypeMismatch
                     throws InvalidValue, TypeMismatch  
279    {    {
280      if (isNull)      if (isNull)
281        throw new TypeMismatch(ISNULL);        throw new TypeMismatch(ISNULL);
# Line 311  public class gnuDynValue Line 302  public class gnuDynValue
302                ((org.omg.CORBA_2_3.ORB) orb).lookup_value_factory(official_type.id());                ((org.omg.CORBA_2_3.ORB) orb).lookup_value_factory(official_type.id());
303              if (factory == null)              if (factory == null)
304                throw new MARSHAL("Factory for " + official_type.id() +                throw new MARSHAL("Factory for " + official_type.id() +
305                                  " not registered."                  " not registered."
306                                 );                );
307    
308              OutputStream out = orb.create_output_stream();              OutputStream out = orb.create_output_stream();
309    
# Line 337  public class gnuDynValue Line 328  public class gnuDynValue
328    }    }
329    
330    /** @inheritDoc */    /** @inheritDoc */
331    public void assign(DynAny from)    public void assign(DynAny from) throws TypeMismatch
               throws TypeMismatch  
332    {    {
333      checkType(official_type, from.type());      checkType(official_type, from.type());
334    
# Line 376  public class gnuDynValue Line 366  public class gnuDynValue
366    }    }
367    
368    /** {@inheritDoc} */    /** {@inheritDoc} */
369    public Serializable get_val()    public Serializable get_val() throws TypeMismatch, InvalidValue
                        throws TypeMismatch, InvalidValue  
370    {    {
371      return to_any().extract_Value();      return to_any().extract_Value();
372    }    }
373    
   
374    /** {@inheritDoc} */    /** {@inheritDoc} */
375    public void insert_val(Serializable a_x)    public void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch
                   throws InvalidValue, TypeMismatch  
376    {    {
377      Any a = to_any();      Any a = to_any();
378      a.insert_Value(a_x);      a.insert_Value(a_x);

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26