Class RhinoDomain

java.lang.Object
io.higson.runtime.rhino.RhinoDomain

public class RhinoDomain extends Object
Author:
przemek hertel
  • Constructor Details

  • Method Details

    • get

      public RhinoDomainElement get(String profile, String path, HigsonContext ctx)
      Returns the element of domain identified by the provided path for given profile, evaluated with the provided context.
      Parameters:
      profile - code of the profile,
      path - domain path starting from the root element. The path separator ('/') at the beginning of path is optional. null or empty path ("") corresponds to the root element.
      ctx - HigsonContext object.
      Returns:
      if path points to single domain element (not collection), the result is the element of domain identified by the path for the given profile.

      If path == null, the result is the root domain element.

      If path points to non-empty collection, the result is any element of the collection. WARNING: It is not guaranteed which element of the collection will be returned. In future releases the value returned in this case will be different. Therefore, at the moment it is strongly discouraged to use this method with path pointing to a collection.

      In all cases the returned element will be evaluated with the provided context object ctx, unless it is null. If ctx == null, the returned element will not have a context object to evaluate with.

      Throws:
      HigsonRuntimeException - if profile != null and any of the following is true:
      • profile with the given code does not exist in the system, or
      • there are no domain elements in the profile with the given code, or
      • path is not a valid domain path starting from the root element for the given profile, or
      • path points to an empty collection. WARNING: this behaviour is likely to change in future releases.
    • get

      public RhinoDomainElement get(String profile, String path)
      Returns the element of domain identified by the provided path for given profile.
      Parameters:
      profile - code of the profile,
      path - domain path starting from the root element. The path separator ('/') at the beginning of path is optional. null or empty path ("") corresponds to the root element.
      Returns:
      if path points to single domain element (not collection), the result is the element of domain identified by the path for the given profile.

      If path == null, the result is the root domain element.

      If path points to non-empty collection, the result is any element of the collection. WARNING: It is not guaranteed which element of the collection will be returned. In future releases the value returned in this case will be different. Therefore, at the moment it is strongly discouraged to use this method with path pointing to a collection.

      In all cases the returned element will not have a context object to be evaluated with.

      Throws:
      HigsonRuntimeException - if profile != null and any of the following is true:
      • profile with the given code does not exist in the system, or
      • there are no domain elements in the profile with the given code, or
      • path is not a valid domain path starting from the root element for the given profile, or
      • path points to an empty collection. WARNING: this behaviour is likely to change in future releases.
    • get

      public RhinoDomainElement get(String profile, HigsonContext ctx)
      Returns the root element of domain for given profile, associated with the given context object.
      Parameters:
      profile - code of the profile,
      ctx - context object.
      Returns:
      root element of domain associated with the profile. Returned domain element will be evaluated with the provided HigsonContext object, unless ctx == null. If that case the returned domain element will not have a context object to be evaluated with.
      Throws:
      HigsonRuntimeException - if profile != null and any of the following is true::
      • profile with the given code does not exist in the system or
      • there are no domain elements in the profile with the given code.
    • get

      public RhinoDomainElement get(String profile)
      Returns the root element of domain for given profile.
      Parameters:
      profile - code of the profile.
      Returns:
      root element of domain associated with the profile. The returned element will not have a context object to be evaluated with.
      Throws:
      HigsonRuntimeException - if:
      • profile != null and profile with the given code does not exist in the system or
      • profile != null and there are no domain elements in the profile with the given code.
      RuntimeException - if profile == null.
    • getProfiles

      public List<String> getProfiles()
      Returns codes of profiles with at least one domain element.
      Returns:
      List of profile codes for all profiles with at least one domain element, or empty list if there are no such profiles.