1 23 24 package org.enhydra.kelp.forte.services; 25 26 import java.util.*; 27 28 import org.openide.compiler.*; 29 import org.openide.compiler.Compiler; 30 import org.openide.execution.NbProcessDescriptor; 31 import org.openide.filesystems.FileObject; 32 import org.openide.filesystems.FileUtil; 33 34 public class XMLCCompiler extends ExternalCompiler { 35 36 private boolean building; 37 private String myOpt; 39 40 private XMLCCompilerType myType; 41 42 43 45 47 49 51 XMLCCompilerType getMyType() { 52 return myType; 53 } 54 55 62 70 71 public XMLCCompiler(boolean building, FileObject primFile, NbProcessDescriptor compiler, ExternalCompiler.ErrorExpression errExpr, String myOpt) { 72 super (primFile, building ? BUILD : COMPILE, compiler, errExpr); 73 this.building = building; 74 this.myOpt = myOpt; } 76 77 78 88 89 public boolean equals (Object o) { 91 if (! super.equals (o)) return false; 92 if (! (o instanceof XMLCCompiler)) return false; 93 XMLCCompiler other = (XMLCCompiler) o; 94 return myOpt.equals (other.myOpt) && 97 building == other.building; 98 } 99 100 public int hashCode () { 102 return 9876 ^ getFileObject ().getPackageNameExt ('/', '.').hashCode (); 103 } 104 105 public String getMyOpt () { 107 return myOpt; 108 } 109 110 public boolean isUpToDate () { 111 if (building) return false; 113 FileObject fo = getFileObject (); 116 FileObject compiled = FileUtil.findBrother (fo, "compiledExt"); 117 if (compiled == null) return false; 119 return compiled.lastModified ().after (fo.lastModified ()); 121 } 122 123 public Class compilerGroupClass () { 125 return XMLCCompilerGroup.class; 126 } 127 128 public Object compilerGroupKey () { 131 List l = new ArrayList (2); 132 l.add (super.compilerGroupKey ()); 133 l.add (getMyOpt ()); 134 return l; 135 } 136 137 } 138 | Popular Tags |