// Path: src/com/fivium/scriptrunner2/loader/BuiltInLoader.java
// public abstract class BuiltInLoader
// implements Loader {
//   
//   public static final String LOADER_NAME_DB_SOURCE = "DatabaseSource";
//   public static final String LOADER_NAME_DB_SOURCE_WITH_COMMIT = "DatabaseSourceImplicitCommit";
//   public static final String LOADER_NAME_SCRIPTRUNNER_UTIL = "ScriptRunnerUtil";
//   public static final String LOADER_NAME_PATCH = "Patch";
//   /** Special loader name for the builder only - files associated with this loader are ignored when constructing the manifest. */
//   public static final String LOADER_NAME_IGNORE = "Ignore";
//   
//   private static final Map<String, Loader> gBuiltInLoaderMap;
//   static {
//     gBuiltInLoaderMap = new HashMap<String, Loader>();
//     gBuiltInLoaderMap.put(LOADER_NAME_DB_SOURCE, new DatabaseSourceLoader());
//     gBuiltInLoaderMap.put(LOADER_NAME_DB_SOURCE_WITH_COMMIT, new DatabaseSourceLoader(true));
//     gBuiltInLoaderMap.put(LOADER_NAME_SCRIPTRUNNER_UTIL, UtilLoader.getInstance());
//     gBuiltInLoaderMap.put(LOADER_NAME_PATCH, new PatchScriptLoader());
//   }
//   
//   /**
//    * Get the built in loader corresponding to the given name, or null if it does not exist.
//    * @param pLoaderName Name of required loader.
//    * @return Built-in loader.
//    */
//   public static Loader getBuiltInLoaderOrNull(String pLoaderName){
//     return gBuiltInLoaderMap.get(pLoaderName);
//   }
// 
//   /**
//    * Gets the map of built-in loaders. The key of the map is the loader name.
//    * @return Map of names to built-in loaders.
//    */
//   public static Map<String, Loader> getBuiltInLoaderMap() {
//     return gBuiltInLoaderMap;
//   }
// 
// }


import com.fivium.scriptrunner2.ManifestEntry;
import com.fivium.scriptrunner2.ex.ExInternal;
import com.fivium.scriptrunner2.loader.BuiltInLoader;
import java.util.Map;
package com.fivium.scriptrunner2.builder;




/**
 * A ManifestEntry which is being used by a builder during manifest construction. This subclass has a mutable sequence
 * position.
 */
public class BuilderManifestEntry 
extends ManifestEntry {
  
  /** This cannot be final as it is not known at construction time */
  private int mSequencePosition = 0;
  
  public BuilderManifestEntry(boolean pIsAugmentation, String pFilePath, String pLoaderName, int pSequence, Map<String, String> pPropertyMap, boolean pIsForcedDuplicate){
    this(pIsAugmentation, pFilePath, pLoaderName, pPropertyMap, pIsForcedDuplicate);    
    mSequencePosition = pSequence;    
  }
  
  public BuilderManifestEntry(boolean pIsAugmentation, String pFilePath, String pLoaderName, Map<String, String> pPropertyMap, boolean pIsForcedDuplicate){
    super(pIsAugmentation, pFilePath, pLoaderName, pPropertyMap, pIsForcedDuplicate); 
    //Validate loader name
    if(!pIsAugmentation && "".equals(getLoaderName())){
      throw new ExInternal("Non-augmentation entry cannot have an empty loader name");
    }
  }
  
  @Override
  public int getSequencePosition(){
    return mSequencePosition;
  }  

  public void setSequencePosition(int pSequencePosition) {
    mSequencePosition = pSequencePosition;
  }  
  
  public boolean isIgnoredEntry() {
// Path: src/com/fivium/scriptrunner2/loader/BuiltInLoader.java
// public abstract class BuiltInLoader
// implements Loader {
//   
//   public static final String LOADER_NAME_DB_SOURCE = "DatabaseSource";
//   public static final String LOADER_NAME_DB_SOURCE_WITH_COMMIT = "DatabaseSourceImplicitCommit";
//   public static final String LOADER_NAME_SCRIPTRUNNER_UTIL = "ScriptRunnerUtil";
//   public static final String LOADER_NAME_PATCH = "Patch";
//   /** Special loader name for the builder only - files associated with this loader are ignored when constructing the manifest. */
//   public static final String LOADER_NAME_IGNORE = "Ignore";
//   
//   private static final Map<String, Loader> gBuiltInLoaderMap;
//   static {
//     gBuiltInLoaderMap = new HashMap<String, Loader>();
//     gBuiltInLoaderMap.put(LOADER_NAME_DB_SOURCE, new DatabaseSourceLoader());
//     gBuiltInLoaderMap.put(LOADER_NAME_DB_SOURCE_WITH_COMMIT, new DatabaseSourceLoader(true));
//     gBuiltInLoaderMap.put(LOADER_NAME_SCRIPTRUNNER_UTIL, UtilLoader.getInstance());
//     gBuiltInLoaderMap.put(LOADER_NAME_PATCH, new PatchScriptLoader());
//   }
//   
//   /**
//    * Get the built in loader corresponding to the given name, or null if it does not exist.
//    * @param pLoaderName Name of required loader.
//    * @return Built-in loader.
//    */
//   public static Loader getBuiltInLoaderOrNull(String pLoaderName){
//     return gBuiltInLoaderMap.get(pLoaderName);
//   }
// 
//   /**
//    * Gets the map of built-in loaders. The key of the map is the loader name.
//    * @return Map of names to built-in loaders.
//    */
//   public static Map<String, Loader> getBuiltInLoaderMap() {
//     return gBuiltInLoaderMap;
//   }
// 
// }


// Path: src/com/fivium/scriptrunner2/builder/BuilderManifestEntry.java
import com.fivium.scriptrunner2.ManifestEntry;
import com.fivium.scriptrunner2.ex.ExInternal;
import com.fivium.scriptrunner2.loader.BuiltInLoader;
import java.util.Map;

package com.fivium.scriptrunner2.builder;




/**
 * A ManifestEntry which is being used by a builder during manifest construction. This subclass has a mutable sequence
 * position.
 */
public class BuilderManifestEntry 
extends ManifestEntry {
  
  /** This cannot be final as it is not known at construction time */
  private int mSequencePosition = 0;
  
  public BuilderManifestEntry(boolean pIsAugmentation, String pFilePath, String pLoaderName, int pSequence, Map<String, String> pPropertyMap, boolean pIsForcedDuplicate){
    this(pIsAugmentation, pFilePath, pLoaderName, pPropertyMap, pIsForcedDuplicate);    
    mSequencePosition = pSequence;    
  }
  
  public BuilderManifestEntry(boolean pIsAugmentation, String pFilePath, String pLoaderName, Map<String, String> pPropertyMap, boolean pIsForcedDuplicate){
    super(pIsAugmentation, pFilePath, pLoaderName, pPropertyMap, pIsForcedDuplicate); 
    //Validate loader name
    if(!pIsAugmentation && "".equals(getLoaderName())){
      throw new ExInternal("Non-augmentation entry cannot have an empty loader name");
    }
  }
  
  @Override
  public int getSequencePosition(){
    return mSequencePosition;
  }  

  public void setSequencePosition(int pSequencePosition) {
    mSequencePosition = pSequencePosition;
  }  
  
  public boolean isIgnoredEntry() {
    return BuiltInLoader.LOADER_NAME_IGNORE.equals(getLoaderName());