PreSetDef.PreSetDefinition (Apache Ant API)
Date: 2015-06-29

org.apache.tools.ant.taskdefs

## Class PreSetDef.PreSetDefinition

- java.lang.Object
- - org.apache.tools.ant.AntTypeDefinition
  - - org.apache.tools.ant.taskdefs.PreSetDef.PreSetDefinition

- Enclosing class:
    PreSetDef

      public static class PreSetDef.PreSetDefinition
      extends AntTypeDefinition

  This class contains the unknown element and the object that is predefined.
  See Also:
    `AntTypeDefinition`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreSetDef.PreSetDefinition(AntTypeDefinition parent, UnknownElement el)` Creates a new `PresetDefinition` instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkClass(Project project)` Check if the attributes are correct.
    `java.lang.Object` | `create(Project project)` Fake create an object, used by IntrospectionHelper and UnknownElement to see that this is a predefined object.
    `java.lang.Object` | `createObject(Project project)` Create an instance of the definition.
    `java.lang.ClassLoader` | `getClassLoader()` Get the classloader for this definition.
    `java.lang.String` | `getClassName()` Get the classname of the definition.
    `java.lang.Class` | `getExposedClass(Project project)` Get the exposed class for this definition.
    `UnknownElement` | `getPreSets()` Get the preset values.
    `java.lang.Class` | `getTypeClass(Project project)` Get the definition class.
    `boolean` | `sameDefinition(AntTypeDefinition other, Project project)` Equality method for this definition.
    `void` | `setAdapterClass(java.lang.Class adapterClass)` Set the adapter class for this definition.
    `void` | `setAdaptToClass(java.lang.Class adaptToClass)` Set the assignable class for this definition.
    `void` | `setClass(java.lang.Class clazz)` Override so that it is not allowed.
    `void` | `setClassLoader(java.lang.ClassLoader classLoader)` Set the classloader to use to create an instance of the definition.
    `void` | `setClassName(java.lang.String className)` Override so that it is not allowed.
    `boolean` | `similarDefinition(AntTypeDefinition other, Project project)` Similar method for this definition.

    - ### Methods inherited from class org.apache.tools.ant.AntTypeDefinition

      `getName, innerCreateAndSet, innerGetTypeClass, isRestrict, setName, setRestrict`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PreSetDef.PreSetDefinition

          public PreSetDef.PreSetDefinition(AntTypeDefinition parent,
                                    UnknownElement el)

      Creates a new `PresetDefinition` instance.
      Parameters:
        `parent` - The parent of this predefinition.
        `el` - The predefined attributes, nested elements and text.

  - ### Method Detail

    - #### setClass

          public void setClass(java.lang.Class clazz)

      Override so that it is not allowed.
      Overrides:
        `setClass` in class `AntTypeDefinition`
      Parameters:
        `clazz` - a `Class` value.

    - #### setClassName

          public void setClassName(java.lang.String className)

      Override so that it is not allowed.
      Overrides:
        `setClassName` in class `AntTypeDefinition`
      Parameters:
        `className` - a `String` value.

    - #### getClassName

          public java.lang.String getClassName()

      Get the classname of the definition.
      Overrides:
        `getClassName` in class `AntTypeDefinition`
      Returns:
        the name of the class of this definition.

    - #### setAdapterClass

          public void setAdapterClass(java.lang.Class adapterClass)

      Set the adapter class for this definition. NOT Supported
      Overrides:
        `setAdapterClass` in class `AntTypeDefinition`
      Parameters:
        `adapterClass` - the adapterClass.

    - #### setAdaptToClass

          public void setAdaptToClass(java.lang.Class adaptToClass)

      Set the assignable class for this definition. NOT SUPPORTED
      Overrides:
        `setAdaptToClass` in class `AntTypeDefinition`
      Parameters:
        `adaptToClass` - the assignable class.

    - #### setClassLoader

          public void setClassLoader(java.lang.ClassLoader classLoader)

      Set the classloader to use to create an instance of the definition. NOT SUPPORTED
      Overrides:
        `setClassLoader` in class `AntTypeDefinition`
      Parameters:
        `classLoader` - the classLoader.

    - #### getClassLoader

          public java.lang.ClassLoader getClassLoader()

      Get the classloader for this definition.
      Overrides:
        `getClassLoader` in class `AntTypeDefinition`
      Returns:
        the classloader for this definition.

    - #### getExposedClass

          public java.lang.Class getExposedClass(Project project)

      Get the exposed class for this definition.
      Overrides:
        `getExposedClass` in class `AntTypeDefinition`
      Parameters:
        `project` - the current project.
      Returns:
        the exposed class.

    - #### getTypeClass

          public java.lang.Class getTypeClass(Project project)

      Get the definition class.
      Overrides:
        `getTypeClass` in class `AntTypeDefinition`
      Parameters:
        `project` - the current project.
      Returns:
        the type of the definition.

    - #### checkClass

          public void checkClass(Project project)

      Check if the attributes are correct.
      Overrides:
        `checkClass` in class `AntTypeDefinition`
      Parameters:
        `project` - the current project.

    - #### createObject

          public java.lang.Object createObject(Project project)

      Create an instance of the definition. The instance may be wrapped in a proxy class. This is a special version of create for IntrospectionHelper and UnknownElement.
      Parameters:
        `project` - the current project.
      Returns:
        the created object.

    - #### getPreSets

          public UnknownElement getPreSets()

      Get the preset values.
      Returns:
        the predefined attributes, elements and text as an UnknownElement.

    - #### create

          public java.lang.Object create(Project project)

      Fake create an object, used by IntrospectionHelper and UnknownElement to see that this is a predefined object.
      Overrides:
        `create` in class `AntTypeDefinition`
      Parameters:
        `project` - the current project.
      Returns:
        this object.

    - #### sameDefinition

          public boolean sameDefinition(AntTypeDefinition other,
                               Project project)

      Equality method for this definition.
      Overrides:
        `sameDefinition` in class `AntTypeDefinition`
      Parameters:
        `other` - another definition.
        `project` - the current project.
      Returns:
        true if the definitions are the same.

    - #### similarDefinition

          public boolean similarDefinition(AntTypeDefinition other,
                                  Project project)

      Similar method for this definition.
      Overrides:
        `similarDefinition` in class `AntTypeDefinition`
      Parameters:
        `other` - another definition.
        `project` - the current project.
      Returns:
        true if the definitions are similar.