Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2004, 2005 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.ant.internal.ui.model;
 
 import java.io.File;
 import java.util.Map;
 
 import  org.apache.tools.ant.BuildException;
 import  org.apache.tools.ant.Project;
 import  org.apache.tools.ant.Target;
 import  org.apache.tools.ant.Task;
 
 public interface IAntModel {

    
Returns the project node for this Ant model

Returns:
the project node for this Ant model
 
     AntProjectNode getProjectNode();

    
Returns the name of the external entity defined by the specified path

Parameters:
path the path to the entity
Returns:
the name or the entity or null if no entity could be resolved
 
     String getEntityName(String path);

    
Returns the location provider for this Ant model

Returns:
the location provider for this Ant model
 
Disposes this Ant model
 
     void dispose();

    
Reconciles this Ant model with the buildfile it represents
 
     void reconcile();

    
Sets the classloader for this Ant model

Parameters:
newClassLoader the classloader to use when resolving this Ant model
 
     void setClassLoader(URLClassLoader newClassLoader);
    
    
Sets the extra properties to be used for parsing If global settings as defined in the Ant UI preferences are to be used this method does not need to be called.

Parameters:
properties the properties to ensure are set for parsing.
 
     void setProperties(Map properties);
    
    
Sets the property files to be used for parsing If global settings as defined in the Ant UI preferences are to be used this method does not need to be called.

Parameters:
propertyFiles the file names of the property files to use for parsing
 
     void setPropertyFiles(String[] propertyFiles);

    
Returns the Eclipse resource for the buildfile this Ant model represents

Returns:
the Eclipse resource or null</null> if the buildfile is not in the workspace
 
     IFile getFile();

    
Handles a BuildException that occurred during parsing.

Parameters:
be the build exception that occurred
node the node associated with the problem
severity the severity of the problem
 
     void handleBuildException(BuildException beAntElementNode nodeint severity);

    
Returns the project node for this Ant model

Parameters:
reconcile whether or not to ensure the Ant model is reconciled before retrieving the project node
Returns:
the project node for this Ant model
 
     AntProjectNode getProjectNode(boolean reconcile);

    
Adds the new target to this Ant model

Parameters:
newTarget the new Apache Ant target
lineNumber the line number of the new target
columnNumber the column number of the new target
    void addTarget(Target newTargetint lineNumberint columnNumber);

    
Adds the new project to this Ant model

Parameters:
project the new Apache Ant project
lineNumber the line number of the new target
columnNumber the column number of the new target
    void addProject(Project projectint lineNumberint columnNumber);

    
Return the java.io.File that is the buildfile that this Ant model represents

Returns:
the java.io.File that is the buildfile
    //TODO Could this just be getPath().toLocation();
    File getEditedFile();
    
    
Returns whether this model contains task information

Returns:
whether task information is included in this model
    boolean canGetTaskInfo();
    
    
Returns whether this model contains lexical information

Returns:
whether lexical information is included in this model
    boolean canGetLexicalInfo();
    
    
Returns whether this model contains position information for the elements

Returns:
whether position information is included in this model
    boolean canGetPositionInfo();

    
Adds a comment to the Ant model Only called if canGetLexicalInfo() is true

Parameters:
lineNumber the line number of the comment
columnNumber the column number of the comment
length the length of the comment
    void addComment(int lineNumberint columnNumberint length);

    
Adds a DTD element to the Ant model Only called if canGetLexicalInfo() is true

Parameters:
name the name of the DTD element
lineNumber the line number of the comment
columnNumber the column number of the comment
    void addDTD(String nameint lineNumberint columnNumber);

    
Adds the external entity to the Ant model

Parameters:
name the name of the external entity
currentEntityPath the path of the entity
    void addEntity(String nameString currentEntityPath);

    
Adds a task element to the Ant model Only called if canGetTaskInfo()() is true

Parameters:
task the new Apache Ant task
parentTask the parent Apache Ant task or null
attributes the attributes of the new task
lineNumber the line number of the task
columnNumber the column number of the task
    void addTask(Task newTask, Task parentTaskAttributes attributesint lineNumberint columnNumber);

    
Sets the length of the current element that was just finished being parsed

Parameters:
lineNumber the current line number of parsing
columnNumber the current column number of parsing
    void setCurrentElementLength(int lineNumberint columnNumber);

    
Returns the offset in the document associated with this Ant model for the given line number and position in the line

Parameters:
lineNumber the line number in the doc
column the column number in that line
Returns:
the offset in the document
Throws:
BadLocationException
    int getOffset(int lineNumberint columnthrows BadLocationException;

    
Handles a fatal error from an exception during parsing.

Parameters:
e the exception that occurred
    void error(Exception e);

    
Handles a fatal error from an exception during parsing.

Parameters:
e the exception that occurred
    void fatalError(Exception e);

    
Handles a warning from an exception during parsing.

Parameters:
e the exception that occurred
    void warning(Exception e);
    void errorFromElement(Exception eAntElementNode elementint lineNumberint columnNumber);
    void errorFromElementText(Exception eint offsetint columnNumber);

    
Returns the text in the document of this Ant model for the given offset and length

Parameters:
offset the offset within the document
length the length of text to retrieve
Returns:
the text at the given offset of null if not contained within the document range
    String getText(int offsetint length);
    
    
Caches the text from the provided defining node so that the node definitions are only updated if the text changes on reconciliation

Parameters:
node the defining task node to cache the associated text
    void setDefiningTaskNodeText(AntDefiningTaskNode node);

    
Record the prefix-URI Namespace mapping.

Parameters:
prefix The Namespace prefix being declared.
uri The Namespace URI the prefix is mapped to.
    void addPrefixMapping(String prefixString uri);
New to GrepCode? Check out our FAQ X