org.eclipse.wst.jsdt.js.node.common.util

## Class PackageJsonUtil

- java.lang.Object
- - org.eclipse.wst.jsdt.js.node.common.util.PackageJsonUtil

    public class PackageJsonUtil
    extends java.lang.Object

package.json utils

See Also:
  https://docs.npmjs.com/files/package.json

### Constructor Summary

Constructors
Constructor and Description
`PackageJsonUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static PackageJson` `readPackageJsonFromFile(java.lang.String fileLocation)` Reads a package.json file at the specified location and returns a PackageJson object representing the package.json attributes and values.
`static PackageJson` `readPackageJsonFromIFile(IFile file)` Reads a package.json file specified in the IFile and returns a PackageJson object representing the package.json attributes and values.
`static PackageJson` `readPackageJsonFromIResource(IResource resource)` Reads a package.json contained in the IResource given and returns a PackageJson object representing the package.json attributes and values.

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

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

### Constructor Detail

#### PackageJsonUtil

    public PackageJsonUtil()

### Method Detail

#### readPackageJsonFromFile

    public static PackageJson readPackageJsonFromFile(java.lang.String fileLocation)
                                               throws java.io.FileNotFoundException

Reads a package.json file at the specified location and returns a PackageJson object representing the package.json attributes and values.

Parameters:
  `fileLocation` - Absolute path of the package.json file
Returns:
  PackageJson object representing the package.json file
Throws:
  `java.io.FileNotFoundException`

#### readPackageJsonFromIFile

    public static PackageJson readPackageJsonFromIFile(IFile file)
                                                throws java.io.FileNotFoundException

Reads a package.json file specified in the IFile and returns a PackageJson object representing the package.json attributes and values.

Parameters:
  `file` - containing the package.json file
Returns:
  PackageJson object representing the package.json file
Throws:
  `java.io.FileNotFoundException`

#### readPackageJsonFromIResource

    public static PackageJson readPackageJsonFromIResource(IResource resource)

Reads a package.json contained in the IResource given and returns a PackageJson object representing the package.json attributes and values.

Parameters:
  `resource` - IResource containing a package.json file
Returns:
  PackageJson object representing the package.json file