Enum PolymerExportPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PolymerExportPolicy>

    public enum PolymerExportPolicy
    extends java.lang.Enum<PolymerExportPolicy>
    How to handle exports/externs for Polymer properties and methods.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      EXPORT_ALL
      Add all Polymer properties and methods to the externs.
      LEGACY
      If --polymer_version=1, add all Polymer properties (but not methods) to the externs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PolymerExportPolicy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PolymerExportPolicy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LEGACY

        public static final PolymerExportPolicy LEGACY
        If --polymer_version=1, add all Polymer properties (but not methods) to the externs. If --polymer_version=2, add readOnly and reflectToAttribute Polymer properties (but not methods) to the externs. This policy is is not generally safe for use with renaming and unused code optimizations, unless additional steps are taken (e.g. manual exports, goog.reflect.objectProperty, the PolymerRenamer post-processor).
      • EXPORT_ALL

        public static final PolymerExportPolicy EXPORT_ALL
        Add all Polymer properties and methods to the externs. Since any of these definitions could be referenced by string in HTML templates, observer definitions, or computed property definitions, this is a blunt but safe way to allow Polymer code to be used with renaming and unused code optimizations enabled.
    • Method Detail

      • values

        public static PolymerExportPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PolymerExportPolicy c : PolymerExportPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PolymerExportPolicy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null