Package org.esa.snap.core.dataio
Class AbstractProductBuilder
java.lang.Object
org.esa.snap.core.dataio.AbstractProductReader
org.esa.snap.core.dataio.AbstractProductBuilder
- All Implemented Interfaces:
ProductReader
- Direct Known Subclasses:
ProductFlipper,ProductSubsetBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Band, RasterDataNode> protected Stringprotected Stringprotected intprotected intprotected Productprotected booleanFields inherited from class org.esa.snap.core.dataio.AbstractProductReader
input -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddAttribString(String name, String value, MetadataElement subsetElem) protected voidaddFlagCodingsToProduct(Product target) protected voidaddIndexCodingsToProduct(Product target) protected voidaddMetadataToProduct(Product product) protected voidcloneFlags(FlagCoding sourceFlagCoding, FlagCoding destFlagCoding) protected voidcloneIndexes(IndexCoding sourceFlagCoding, IndexCoding destFlagCoding) protected voidcloneMetadataAttributes(MetadataElement sourceRoot, MetadataElement destRoot) protected voidcloneMetadataElements(MetadataElement sourceRoot, MetadataElement destRoot, int level) protected voidcloneMetadataElementsAndAttributes(MetadataElement sourceRoot, MetadataElement destRoot, int level) voidclose()Closes the access to all currently opened resources such as file input streams and all resources of this children directly owned by this reader.protected voidintintprotected booleanisInstanceOfValidInputType(Object input) Checks if the given object is an instance of one of the valid input types for this product reader.booleanprotected ProductreadProductNodes(Product sourceProduct, ProductSubsetDef subsetDef, String name, String desc) protected abstract ProductProvides an implementation of thereadProductNodesinterface method.voidsetNewProductDesc(String newProductDesc) voidsetNewProductName(String newProductName) Methods inherited from class org.esa.snap.core.dataio.AbstractProductReader
buildTiePointGrid, buildTiePointGrid, configurePreferredTileSize, convertInputToPath, createTiePointGrid, getGridDiscontinutity, getInput, getProductComponents, getReaderPlugIn, getSubsetDef, isMetadataIgnored, isNodeAccepted, isSubsetReadingFullySupported, readBandRasterData, readBandRasterDataImpl, readGeoCoding, readProductNodes, setInput, setSubsetDef, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.esa.snap.core.dataio.ProductReader
getProductFile, getProductInputStream, getProductInputStream, getProductPath, getProductPath, readTiePointGridRasterData
-
Field Details
-
sourceProduct
-
sourceProductOwner
protected boolean sourceProductOwner -
sceneRasterWidth
protected int sceneRasterWidth -
sceneRasterHeight
protected int sceneRasterHeight -
newProductName
-
newProductDesc
-
bandMap
-
-
Constructor Details
-
AbstractProductBuilder
public AbstractProductBuilder(boolean sourceProductOwner)
-
-
Method Details
-
getSourceProduct
-
isSourceProductOwner
public boolean isSourceProductOwner() -
setNewProductDesc
-
setNewProductName
-
getSceneRasterWidth
public int getSceneRasterWidth() -
getSceneRasterHeight
public int getSceneRasterHeight() -
readProductNodes
protected Product readProductNodes(Product sourceProduct, ProductSubsetDef subsetDef, String name, String desc) throws IOException - Throws:
IOException
-
readProductNodesImpl
Description copied from class:AbstractProductReaderProvides an implementation of thereadProductNodesinterface method. Clients implementing this method can be sure that the input object and eventually the subset information has already been set.This method is called as a last step in the
readProductNodes(input, subsetInfo)method.- Specified by:
readProductNodesImplin classAbstractProductReader- Returns:
- a new product instance
- Throws:
IOException- if an I/O error occurs
-
close
Closes the access to all currently opened resources such as file input streams and all resources of this children directly owned by this reader. Its primary use is to allow the garbage collector to perform a vanilla job.This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to
close()are undefined.Overrides of this method should always call
super.close();after disposing this instance.- Specified by:
closein interfaceProductReader- Overrides:
closein classAbstractProductReader- Throws:
IOException- if an I/O error occurs
-
addFlagCodingsToProduct
-
addIndexCodingsToProduct
-
addAttribString
-
cloneFlags
-
cloneIndexes
-
addMetadataToProduct
-
cloneMetadataElementsAndAttributes
protected void cloneMetadataElementsAndAttributes(MetadataElement sourceRoot, MetadataElement destRoot, int level) -
cloneMetadataElements
protected void cloneMetadataElements(MetadataElement sourceRoot, MetadataElement destRoot, int level) -
cloneMetadataAttributes
-
isInstanceOfValidInputType
Description copied from class:AbstractProductReaderChecks if the given object is an instance of one of the valid input types for this product reader.- Overrides:
isInstanceOfValidInputTypein classAbstractProductReader- Parameters:
input- the input object passed toAbstractProductReader.readProductNodes(Object, ProductSubsetDef)- Returns:
trueif so- See Also:
-
disposeBandMap
protected void disposeBandMap()
-