001/* DynValueOperations.java --
002   Copyright (C) 2005 Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038
039package org.omg.DynamicAny;
040
041import org.omg.CORBA.TCKind;
042import org.omg.DynamicAny.DynAnyPackage.InvalidValue;
043import org.omg.DynamicAny.DynAnyPackage.TypeMismatch;
044
045/**
046 * Defines operations, applicable to DynValue. From the view point of DynAny,
047 * the Value is very much like structure. However, differently from the
048 * structure, the value type can also have private members. The private members
049 * of DynValue are also accessible via this interface, but this possibility
050 * should only be used in applications like in debuggers or inter-orb bridges.
051 * Unlike structure, the value can also be equal to <code>null</code>.
052 *
053 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
054 */
055public interface DynValueOperations
056  extends DynAnyOperations, DynValueCommonOperations
057{
058  /**
059   * Get the kind of the current member.
060   *
061   * @return the kind of member at the current position.
062   *
063   * @throws TypeMismatch if this DynValue is holding <code>null</code>.
064   * @thorws InvalidValue if the current position does not indicate the member.
065   */
066  TCKind current_member_kind()
067    throws TypeMismatch, InvalidValue;
068
069  /**
070   * Get the name of the current member.
071   *
072   * @return the name of the current member as defined by the typecode. May be
073   * an empty string.
074   *
075   * @throws TypeMismatch if this DynValue is holding <code>null</code>.
076   * @thorws InvalidValue if the current position does not indicate the member.
077   */
078  String current_member_name()
079    throws TypeMismatch, InvalidValue;
080
081  /**
082   * Get all members as an array of the named DynAny's. The returned names are
083   * set as they are defined by typecode.
084   *
085   * @return the array, representing the members of this instance of value.
086   *
087   * @throws InvalidValue if this DynValue is holding <code>null</code>.
088   */
089  NameDynAnyPair[] get_members_as_dyn_any()
090    throws InvalidValue;
091
092  /**
093   * Get all members as an array of the named Any's. The returned names are set
094   * as they are defined by typecode.
095   *
096   * @return the array, representing the members of this instance of value.
097   *
098   * @throws InvalidValue if this DynValue is holding <code>null</code>.
099   */
100  NameValuePair[] get_members()
101    throws InvalidValue;
102
103  /**
104   * Set all members from the array of the named Any's.
105   *
106   * @param value the array, where the data for fields of the structure must
107   * occur exactly in the same order, as defined by typecode.
108   *
109   * @throws TypeMismatch if the type or name of the array member does not match
110   * the name and type of the corresponding field in the DynValue data
111   * structure. The empty string is assumed matching any name.
112   *
113   * @throws InvalidValue if the size of the array does not match the number of
114   * fields.
115   */
116  void set_members_as_dyn_any(NameDynAnyPair[] value)
117    throws TypeMismatch, InvalidValue;
118
119  /**
120   * Set all members from the array of the named Any's.
121   *
122   * @param value the array, where the data for fields of the structure must
123   * occur exactly in the same order, as defined by typecode.
124   *
125   * @throws TypeMismatch if the type or name of the array member does not match
126   * the name and type of the corresponding field in the DynValue data
127   * structure. The empty string is assumed matching any name.
128   *
129   * @throws InvalidValue if the size of the array does not match the number of
130   * fields.
131   */
132  void set_members(NameValuePair[] value)
133    throws TypeMismatch, InvalidValue;
134}