You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/02/05 23:25:48 UTC

DO NOT REPLY [Bug 52608] New: Project.createDataType(String) arguments

https://issues.apache.org/bugzilla/show_bug.cgi?id=52608

             Bug #: 52608
           Summary: Project.createDataType(String) arguments
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: mansour.alakeel@gmail.com
    Classification: Unclassified


Currently Project.createDataType takes a string as an argument. For example:
assuming we have our antlib.xml located under the package:
org.ant.plugins and within that antlib.xml we defined a type called "myType"

then creating a default object of this would be like:

getProject().createDataType("antlib:org.ant.plugin:myType"). 

It will be easier to do : createDataType(full.class.name.of.myType).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52608] Project.createDataType(String) arguments

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52608

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2012-02-06 11:27:17 UTC ---
The primary purpose of createDataType is to create tasks/types by the name used
by Ant - when you don't know the implementation class.

Why would you want to invoke this method if you already know the class you want
to instantiate?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52608] Project.createDataType(String) arguments

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52608

Mansour <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #2 from Mansour <ma...@gmail.com> 2012-02-07 06:20:18 UTC ---
Stefan,

I was trying to write a proxy for some datatype, that will create another
datatype based on the configuration.
For example, a datatype called Artifact.java that will create another datatypes
based on the information passed (jar,war, ejb ... etc). 

Therefor, I requested this feature. However, I refactored some of my code, and
it turned out that I don't really need this. On the other hand, I believe it
can be done easily using reflection and newInstance. (ie, 

MyDataType dataType = (MyDataType) obj;
dataType.setProject(aProject);

I think we can ignore this request, and close it.

Thank you.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.