package com.github.legioth.propertysource.client;

import com.google.gwt.core.shared.GWT;
import java.util.List;

/**
 * Each method in a subclass will be generated to return the value of returned
 * by that method during GWT compilation. This can be used to produce constant
 * return values based on e.g. property values or other information statically
 * available during GWT compilation.
 * <p/>
 * Property values can be accessed using
 * {@link #getSelectionPropertyValue(String)} and
 * {@link #getConfigurationPropertyValues(String)}. These methods can only be
 * used during GWT compilation.
 * <p/>
 * Supported return types for the methods are <code>String</code>,
 * <code>boolean</code> and <code>List&lt;String&gt</code>.
 *
 * @see PropertySource
 */
public class DynamicPropertySource
  implements PropertySource
{
  /**
   * Helper interface used during GWT compilation to find property values.
   */
  public interface PropertyProxy
  {
    String getSelectionPropertyValue( String name );

    String getSelectionPropertyFallback( String name );

    List<String> getConfigurationPropertyValues( String name );
  }

  // Implementation gets injected here when generating the concrete class
  private PropertyProxy proxy;

  /**
   * Gets the value of the named property that has been defined in gwt.xml
   * files.
   *
   * @param name the name of the property
   * @return the property value as a string
   */
  protected String getSelectionPropertyValue( String name )
  {
    if ( GWT.isClient() )
    {
      throw new IllegalStateException( "Only supported during the comile phase." );
    }
    else
    {
      return proxy.getSelectionPropertyValue( name );
    }
  }

  /**
   * Gets the value of the named property that has been defined in gwt.xml
   * files.
   *
   * @param name the name of the property
   * @return the property value as a string
   */
  protected String getSelectionPropertyFallback( String name )
  {
    if ( GWT.isClient() )
    {
      throw new IllegalStateException( "Only supported during the comile phase." );
    }
    else
    {
      return proxy.getSelectionPropertyFallback( name );
    }
  }

  /**
   * Gets the value of the named configuration property that has been defined
   * in gwt.xml files.
   *
   * @param name the name of the property
   * @return the property values as a list of strings
   */
  protected List<String> getConfigurationPropertyValues( String name )
  {
    if ( GWT.isClient() )
    {
      throw new IllegalStateException( "Only supported during the comile phase." );
    }
    else
    {
      return proxy.getConfigurationPropertyValues( name );
    }
  }
}

@@ -1581,32 +1581,33 @@
 d during the com
+p
 ile phase.%22 );%0A 
@@ -2041,32 +2041,33 @@
 d during the com
+p
 ile phase.%22 );%0A 
@@ -2544,16 +2544,17 @@
  the com
+p
 ile phas

Fix spelling mistake