001package org.galaxyproject.gxformat2.v19_09;
002
003import org.galaxyproject.gxformat2.v19_09.utils.LoaderInstances;
004import org.galaxyproject.gxformat2.v19_09.utils.LoadingOptions;
005import org.galaxyproject.gxformat2.v19_09.utils.LoadingOptionsBuilder;
006import org.galaxyproject.gxformat2.v19_09.utils.SavableImpl;
007import org.galaxyproject.gxformat2.v19_09.utils.ValidationException;
008
009/**
010 * Auto-generated class implementation for
011 * <I>https://galaxyproject.org/gxformat2/gxformat2common#StepPosition</I><br>
012 *
013 * <BLOCKQUOTE>
014 *
015 * This field specifies the location of the step's node when rendered in the workflow editor.
016 *
017 * </BLOCKQUOTE>
018 */
019public class StepPositionImpl extends SavableImpl implements StepPosition {
020  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
021  private java.util.Map<String, Object> extensionFields_ = new java.util.HashMap<String, Object>();
022
023  private Object top;
024
025  /**
026   * Getter for property <I>https://galaxyproject.org/gxformat2/gxformat2common#StepPosition/top</I>
027   * <br>
028   *
029   * <BLOCKQUOTE>
030   *
031   * Relative vertical position of the step's node when rendered in the workflow editor. *
032   *
033   * </BLOCKQUOTE>
034   */
035  public Object getTop() {
036    return this.top;
037  }
038
039  private Object left;
040
041  /**
042   * Getter for property
043   * <I>https://galaxyproject.org/gxformat2/gxformat2common#StepPosition/left</I><br>
044   *
045   * <BLOCKQUOTE>
046   *
047   * Relative horizontal position of the step's node when rendered in the workflow editor. *
048   *
049   * </BLOCKQUOTE>
050   */
051  public Object getLeft() {
052    return this.left;
053  }
054
055  /**
056   * Used by {@link org.galaxyproject.gxformat2.v19_09.utils.RootLoader} to construct instances of
057   * StepPositionImpl.
058   *
059   * @param __doc_ Document fragment to load this record object from (presumably a {@link
060   *     java.util.Map}).
061   * @param __baseUri_ Base URI to generate child document IDs against.
062   * @param __loadingOptions Context for loading URIs and populating objects.
063   * @param __docRoot_ ID at this position in the document (if available) (maybe?)
064   * @throws ValidationException If the document fragment is not a {@link java.util.Map} or
065   *     validation of fields fails.
066   */
067  public StepPositionImpl(
068      final Object __doc_,
069      final String __baseUri_,
070      LoadingOptions __loadingOptions,
071      final String __docRoot_) {
072    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
073    // Prefix plumbing variables with '__' to reduce likelihood of collision with
074    // generated names.
075    String __baseUri = __baseUri_;
076    String __docRoot = __docRoot_;
077    if (!(__doc_ instanceof java.util.Map)) {
078      throw new ValidationException("StepPositionImpl called on non-map");
079    }
080    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
081    final java.util.List<ValidationException> __errors =
082        new java.util.ArrayList<ValidationException>();
083    if (__loadingOptions != null) {
084      this.loadingOptions_ = __loadingOptions;
085    }
086    Object top;
087    try {
088      top =
089          LoaderInstances.union_of_FloatInstance_or_IntegerInstance.loadField(
090              __doc.get("top"), __baseUri, __loadingOptions);
091    } catch (ValidationException e) {
092      top = null; // won't be used but prevents compiler from complaining.
093      final String __message = "the `top` field is not valid because:";
094      __errors.add(new ValidationException(__message, e));
095    }
096    Object left;
097    try {
098      left =
099          LoaderInstances.union_of_FloatInstance_or_IntegerInstance.loadField(
100              __doc.get("left"), __baseUri, __loadingOptions);
101    } catch (ValidationException e) {
102      left = null; // won't be used but prevents compiler from complaining.
103      final String __message = "the `left` field is not valid because:";
104      __errors.add(new ValidationException(__message, e));
105    }
106    if (!__errors.isEmpty()) {
107      throw new ValidationException("Trying 'RecordField'", __errors);
108    }
109    this.top = (Object) top;
110    this.left = (Object) left;
111  }
112}