com.github.marceloverdijk.lesscss4j
Class LessSource

java.lang.Object
  extended by com.github.marceloverdijk.lesscss4j.LessSource

public class LessSource
extends Object

Represents the metadata and content of a LESS source.

Author:
Marcel Overdijk

Constructor Summary
LessSource(File file)
          Constructs a new LessSource.
 
Method Summary
 String getAbsolutePath()
          Returns the absolute pathname of the LESS source.
 String getContent()
          Returns the content of the LESS source.
 Map<String,LessSource> getImports()
          Returns the LESS sources imported by this LESS source.
 long getLastModified()
          Returns the time that the LESS source was last modified.
 long getLastModifiedIncludingImports()
          Returns the time that the LESS source, or one of its imports, was last modified.
 String getNormalizedContent()
          Returns the normalized content of the LESS source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LessSource

public LessSource(File file)
           throws FileNotFoundException,
                  IOException
Constructs a new LessSource.

This will read the metadata and content of the LESS source, and will automatically resolve the imports.

Parameters:
file - The File reference to the LESS source to read.
Throws:
FileNotFoundException - If the LESS source (or one of its imports) could not be found.
IOException - If the LESS source cannot be read.
Method Detail

getAbsolutePath

public String getAbsolutePath()
Returns the absolute pathname of the LESS source.

Returns:
The absolute pathname of the LESS source.

getContent

public String getContent()
Returns the content of the LESS source.

Returns:
The content of the LESS source.

getNormalizedContent

public String getNormalizedContent()
Returns the normalized content of the LESS source.

The normalized content represents the LESS source as a flattened source where import statements have been resolved and replaced by the actual content.

Returns:
The normalized content of the LESS source.

getLastModified

public long getLastModified()
Returns the time that the LESS source was last modified.

Returns:
A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

getLastModifiedIncludingImports

public long getLastModifiedIncludingImports()
Returns the time that the LESS source, or one of its imports, was last modified.

Returns:
A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

getImports

public Map<String,LessSource> getImports()
Returns the LESS sources imported by this LESS source.

The returned imports are represented by a Map<String, LessSource> which contains the filename and the LessSource.

Returns:
The LESS sources imported by this LESS source.


Copyright © 2012. All Rights Reserved.