Java Doc for Util.java in  » IDE-Netbeans » api » org » netbeans » modules » apisupport » project » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » api » org.netbeans.modules.apisupport.project 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.apisupport.project.Util

Util
final public class Util (Code)
Utility methods for the module.
author:
   Jesse Glick, Martin Krauskopf

Inner Class :abstract public static class ComputedPropertyProvider implements PropertyProvider,PropertyChangeListener
Inner Class :final public static class UserPropertiesFileProvider implements PropertyProvider,PropertyChangeListener,ChangeListener

Field Summary
final public static  ErrorManagererr
    


Method Summary
public static  booleanaddDependency(NbModuleProject target, NbModuleProject dependency)
     Delegates to Util.addDependency(NbModuleProject,String) .
public static  booleanaddDependency(NbModuleProject target, String codeNameBase)
     Delegates to Util.addDependency(NbModuleProjectStringStringSpecificationVersionboolean) .
public static  booleanaddDependency(NbModuleProject target, String codeNameBase, String releaseVersion, SpecificationVersion version, boolean useInCompiler)
     Makes target project to be dependend on the given dependency project.
public static  ElementfindElement(Element parent, String name, String namespace)
     Search for an XML element in the direct children of a parent. DOM provides a similar method but it does a recursive search which we do not want.
public static  URLfindJavadoc(ModuleDependency dep, NbPlatform platform)
     Find Javadoc URL for the given module dependency using Javadoc roots of the given platform.
public static  URLfindJavadocForNetBeansOrgModules(ModuleDependency dep)
     Find Javadoc URL for NetBeans.org modules.
public static  LocalizedBundleInfofindLocalizedBundleInfo(FileObject sourceDir, Manifest manifest)
     Search for an appropriate localized bundle (i.e. OpenIDE-Module-Localizing-Bundle) entry in the given manifest taking into account branding and localization (using NbBundle.getLocalizingSuffixes ) and returns an appropriate valid LocalizedBundleInfo instance.
public static  LocalizedBundleInfofindLocalizedBundleInfo(File projectDir)
     Actually deletages to Util.findLocalizedBundleInfo(FileObject,Manifest) .
public static  LocalizedBundleInfofindLocalizedBundleInfoFromJAR(File binaryProject)
     The same as Util.findLocalizedBundleInfo(FileObject,Manifest) but searching in the given JAR representing a NetBeans module.
public static  List<Element>findSubElements(Element parent)
     Find all direct child elements of an element.
public static  StringfindText(Element parent)
     Extract nested text from an element.
public static  StringgetDisplayName(FileObject projectDir)
     Tries to find Project in the given directory.
public static  ManifestgetManifest(FileObject manifestFO)
    
public static  NbModuleProvider.NbModuleTypegetModuleType(Project project)
     Returns NbModuleProvider.NbModuleType from a project's lookup.
public static  FileObjectgetResourceDirectory(Project prj)
     when ever there is need for non-java files creation or lookup, use this method to get the right location for all projects.
public static  booleanisValidJavaFQN(String name)
    
public static  booleanisValidSFSPath(String path)
    
public static  EditableManifestloadManifest(FileObject manifestFO)
     Convenience method for loading EditableManifest from a FileObject .
Parameters:
  manifestFO - file representing manifest
exception:
  FileNotFoundException - if the file represented by the givenFileObject does not exists, is a folder rather than a regularfile or is invalid.
public static  EditablePropertiesloadProperties(FileObject propsFO)
     Convenience method for loading EditableProperties from a FileObject .
public static  StringnormalizeCNB(String value)
     Normalizes the given value to a regular dotted code name base.
public static  Comparator<Project>projectDisplayNameComparator()
     Order projects by display name.
public static  voidscanJarForPackageNames(Set<String> packages, File jarFile)
     Scans a given jar file for all packages which contains at least one .class file.
public static  SortedSet<String>scanProjectForPackageNames(File prjDir)
     Finds all available packages in a given project directory.
public static  voidstoreManifest(FileObject manifestFO, EditableManifest em)
     Convenience method for storing EditableManifest into a FileObject .
public static  voidstoreProperties(FileObject propsFO, EditableProperties props)
     Convenience method for storing EditableProperties into a FileObject .
public static  ElementtranslateXML(Element from, String namespace)
     Convert an XML fragment from one namespace to another.
public static  URLurlForDir(File dir)
     Creates a URL for a directory on disk.
public static  URLurlForDirOrJar(File location)
     Creates a URL for a directory on disk or the root of a JAR.
public static  URLurlForJar(File jar)
     Creates a URL for the root of a JAR on disk.

Field Detail
err
final public static ErrorManager err(Code)





Method Detail
addDependency
public static boolean addDependency(NbModuleProject target, NbModuleProject dependency) throws IOException(Code)
Delegates to Util.addDependency(NbModuleProject,String) .



addDependency
public static boolean addDependency(NbModuleProject target, String codeNameBase) throws IOException(Code)
Delegates to Util.addDependency(NbModuleProjectStringStringSpecificationVersionboolean) .



addDependency
public static boolean addDependency(NbModuleProject target, String codeNameBase, String releaseVersion, SpecificationVersion version, boolean useInCompiler) throws IOException(Code)
Makes target project to be dependend on the given dependency project. I.e. adds new <module-dependency> element into target's project.xml. If such a dependency already exists the method does nothing. If the given code name base cannot be found in the module's universe the method logs informational message and does nothing otherwise.

Note that the method does not save the target project. You need to do so explicitly (see ProjectManager.saveProject ).
Parameters:
  codeNameBase - codename base.
Parameters:
  releaseVersion - release version, if null will be taken from theentry found in platform.
Parameters:
  version - SpecificationVersion specification version, ifnull, will be taken from the entry found in themodule's target platform.
Parameters:
  useInCompiler - whether this this module needs adependency module at a compile time. true if a dependency was successfully added; false otherwise(e.g. when such dependency already exists)




findElement
public static Element findElement(Element parent, String name, String namespace)(Code)
Search for an XML element in the direct children of a parent. DOM provides a similar method but it does a recursive search which we do not want. It also gives a node list and we want only one result.
Parameters:
  parent - a parent element
Parameters:
  name - the intended local name
Parameters:
  namespace - the intended namespace (or null) the one child element with that name, or null if none or more than one



findJavadoc
public static URL findJavadoc(ModuleDependency dep, NbPlatform platform)(Code)
Find Javadoc URL for the given module dependency using Javadoc roots of the given platform. May return null.



findJavadocForNetBeansOrgModules
public static URL findJavadocForNetBeansOrgModules(ModuleDependency dep)(Code)
Find Javadoc URL for NetBeans.org modules. May return null.



findLocalizedBundleInfo
public static LocalizedBundleInfo findLocalizedBundleInfo(FileObject sourceDir, Manifest manifest)(Code)
Search for an appropriate localized bundle (i.e. OpenIDE-Module-Localizing-Bundle) entry in the given manifest taking into account branding and localization (using NbBundle.getLocalizingSuffixes ) and returns an appropriate valid LocalizedBundleInfo instance. By valid it's meant that a found localized bundle contains at least a display name. If valid bundle is not found null is returned.
Parameters:
  sourceDir - source directory to be used for as a searchingpath for the bundle
Parameters:
  manifest - manifest the bundle's path should be extracted from localized bundle info for the given project or null



findLocalizedBundleInfo
public static LocalizedBundleInfo findLocalizedBundleInfo(File projectDir)(Code)
Actually deletages to Util.findLocalizedBundleInfo(FileObject,Manifest) .



findLocalizedBundleInfoFromJAR
public static LocalizedBundleInfo findLocalizedBundleInfoFromJAR(File binaryProject)(Code)
The same as Util.findLocalizedBundleInfo(FileObject,Manifest) but searching in the given JAR representing a NetBeans module.



findSubElements
public static List<Element> findSubElements(Element parent) throws IllegalArgumentException(Code)
Find all direct child elements of an element. More useful than Element.getElementsByTagNameNS because it does not recurse into recursive child elements. Children which are all-whitespace text nodes or comments are ignored; others cause an exception to be thrown.
Parameters:
  parent - a parent element in a DOM tree a list of direct child elements (may be empty)
throws:
  IllegalArgumentException - if there are non-element children besides whitespace



findText
public static String findText(Element parent)(Code)
Extract nested text from an element. Currently does not handle coalescing text nodes, CDATA sections, etc.
Parameters:
  parent - a parent element the nested text, or null if none was found



getDisplayName
public static String getDisplayName(FileObject projectDir)(Code)
Tries to find Project in the given directory. If succeeds delegates to ProjectInformation.getDisplayName . Returns FileUtil.getFileDisplayName otherwise.



getManifest
public static Manifest getManifest(FileObject manifestFO)(Code)



getModuleType
public static NbModuleProvider.NbModuleType getModuleType(Project project)(Code)
Returns NbModuleProvider.NbModuleType from a project's lookup.



getResourceDirectory
public static FileObject getResourceDirectory(Project prj)(Code)
when ever there is need for non-java files creation or lookup, use this method to get the right location for all projects. Eg. maven places resources not next to the java files.



isValidJavaFQN
public static boolean isValidJavaFQN(String name)(Code)
Check whether a given name can serve as a legal
  1. Java class name
  2. Java package name
  3. NB module code name base



isValidSFSPath
public static boolean isValidSFSPath(String path)(Code)



loadManifest
public static EditableManifest loadManifest(FileObject manifestFO) throws IOException(Code)
Convenience method for loading EditableManifest from a FileObject .
Parameters:
  manifestFO - file representing manifest
exception:
  FileNotFoundException - if the file represented by the givenFileObject does not exists, is a folder rather than a regularfile or is invalid. i.e. as it is thrown by FileObject.getInputStream.



loadProperties
public static EditableProperties loadProperties(FileObject propsFO) throws IOException(Code)
Convenience method for loading EditableProperties from a FileObject . New items will alphabetizied by key.
Parameters:
  propsFO - file representing properties file
exception:
  FileNotFoundException - if the file represented by the givenFileObject does not exists, is a folder rather than a regularfile or is invalid. i.e. as it is thrown by FileObject.getInputStream.



normalizeCNB
public static String normalizeCNB(String value)(Code)
Normalizes the given value to a regular dotted code name base.
Parameters:
  value - to be normalized



projectDisplayNameComparator
public static Comparator<Project> projectDisplayNameComparator()(Code)
Order projects by display name.



scanJarForPackageNames
public static void scanJarForPackageNames(Set<String> packages, File jarFile)(Code)
Scans a given jar file for all packages which contains at least one .class file. Found entries are in the form of a regular java package (x.y.z).
Parameters:
  jarFile - jar file to be scanned
Parameters:
  packages - a set into which found packages will be added



scanProjectForPackageNames
public static SortedSet<String> scanProjectForPackageNames(File prjDir)(Code)
Finds all available packages in a given project directory. Found entries are in the form of a regular java package (x.y.z).
Parameters:
  prjDir - directory containing project to be scanned a set of found packages



storeManifest
public static void storeManifest(FileObject manifestFO, EditableManifest em) throws IOException(Code)
Convenience method for storing EditableManifest into a FileObject .
Parameters:
  manifestFO - file representing where manifest will be stored
Parameters:
  em - manifest to be stored
exception:
  IOException - if manifest cannot be written to the file



storeProperties
public static void storeProperties(FileObject propsFO, EditableProperties props) throws IOException(Code)
Convenience method for storing EditableProperties into a FileObject .
Parameters:
  propsFO - file representing where properties will be stored
Parameters:
  props - properties to be stored
exception:
  IOException - if properties cannot be written to the file



translateXML
public static Element translateXML(Element from, String namespace)(Code)
Convert an XML fragment from one namespace to another.



urlForDir
public static URL urlForDir(File dir)(Code)
Creates a URL for a directory on disk. Works correctly even if the directory does not currently exist.



urlForDirOrJar
public static URL urlForDirOrJar(File location)(Code)
Creates a URL for a directory on disk or the root of a JAR. Works correctly whether or not the directory or JAR currently exists. Detects whether the file is supposed to be a directory or a JAR.



urlForJar
public static URL urlForJar(File jar)(Code)
Creates a URL for the root of a JAR on disk.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.