org.ops4j.pax.construct.util
Class RoundTripBndFile

java.lang.Object
  extended by org.ops4j.pax.construct.util.RoundTripBndFile
All Implemented Interfaces:
BndUtils.Bnd

public class RoundTripBndFile
extends java.lang.Object
implements BndUtils.Bnd

Support round-trip editing of Bnd files, preserving formatting as much as possible


Constructor Summary
RoundTripBndFile(java.io.File bndFile)
           
 
Method Summary
 java.io.File getBasedir()
          
 java.util.Set getDirectives()
          
 java.io.File getFile()
          
 java.lang.String getInstruction(java.lang.String directive)
          
 void overlayInstructions(BndUtils.Bnd bnd)
          Overlay existing instructions onto the current setup
 boolean removeInstruction(java.lang.String directive)
          
 void setInstruction(java.lang.String directive, java.lang.String instruction, boolean overwrite)
          
 void write()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundTripBndFile

public RoundTripBndFile(java.io.File bndFile)
                 throws java.io.IOException
Parameters:
bndFile - property file containing Bnd instructions
Throws:
java.io.IOException
Method Detail

getInstruction

public java.lang.String getInstruction(java.lang.String directive)

Specified by:
getInstruction in interface BndUtils.Bnd
Parameters:
directive - a Bnd directive
Returns:
assigned Bnd instruction

setInstruction

public void setInstruction(java.lang.String directive,
                           java.lang.String instruction,
                           boolean overwrite)
                    throws BndUtils.ExistingInstructionException

Specified by:
setInstruction in interface BndUtils.Bnd
Parameters:
directive - a Bnd directive
instruction - a Bnd instruction
overwrite - overwrite existing instruction if true, otherwise throw BndUtils.ExistingInstructionException
Throws:
BndUtils.ExistingInstructionException

removeInstruction

public boolean removeInstruction(java.lang.String directive)

Specified by:
removeInstruction in interface BndUtils.Bnd
Parameters:
directive - a Bnd directive
Returns:
true if there was an existing instruction, otherwise false

getDirectives

public java.util.Set getDirectives()

Specified by:
getDirectives in interface BndUtils.Bnd
Returns:
set of current directive names

overlayInstructions

public void overlayInstructions(BndUtils.Bnd bnd)
Overlay existing instructions onto the current setup

Specified by:
overlayInstructions in interface BndUtils.Bnd
Parameters:
bnd - existing Bnd instructions

getFile

public java.io.File getFile()

Specified by:
getFile in interface BndUtils.Bnd
Returns:
the underlying Bnd instruction file

getBasedir

public java.io.File getBasedir()

Specified by:
getBasedir in interface BndUtils.Bnd
Returns:
the directory containing the Bnd file

write

public void write()
           throws java.io.IOException

Specified by:
write in interface BndUtils.Bnd
Throws:
java.io.IOException


Copyright © 2007-2008 OPS4J. All Rights Reserved.