|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.nbbuild; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Iterator; // IMPORTANT! You may need to mount ant.jar before this class will // compile. So mount the JAR modules/ext/ant-1.4.1.jar (NOT modules/ant.jar) // from your IDE installation directory in your Filesystems before // continuing to ensure that it is in your classpath. import org.apache.tools.ant.*; import org.apache.tools.ant.types.*; /** * @author Jaroslav Tulach */ public class NbEnhanceClass extends Task { /* Path to library containing the patch method */ private Path patchPath; public Path createClasspath() { if (patchPath == null) { patchPath = new Path(getProject()); } return patchPath.createPath(); } /* Name of class with patch method */ private String patchClass = "org.netbeans.PatchByteCode"; public void setPatchClass (String f) { patchClass = f; } /** Name of the method to call. Must have signature byte[] x(byte[], Map) */ private String enhanceMethod = "enhanceClass"; public void setEnhanceMethod (String f) { enhanceMethod = f; } /* Base dir to find classes relative to */ private File basedir; public void setBasedir (File f) { basedir = f; } /* The class to change its super class and the value of the super class. */ public static class Patch { String clazz; String nbSuperClass; String nbImplements; ArrayList members; /** Class in form of java/lang/Object */ public void setClass (String s) { clazz = s; } /** Class in form of java/lang/Object */ public void setSuper (String s) { nbSuperClass = s; } public void setImplements (String s) { nbImplements = s; } public Object createMember () { Member m = new Member(); if (members == null) { members = new ArrayList (); } members.add (m); return m; } public static final class Member extends Object { String name; String rename; public void setName (String s) { name = s; } public void setRename (String s) { rename = s; } } } private ArrayList patches = new ArrayList (); // List |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.