Class ManifestFile
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionManifestFile(File f) Create an instance of this class from a manifest file on the file system.Create an instance of this class loaded from the contents of an input stream.Create an instance of this class loaded from the contents of a reader.ManifestFile(Class<?> c) Finds and loads the manifest file of the jar file that the specified class is contained within.ManifestFile(Path path) Create an instance of this class from a manifest path on the file system.Create an instance of this class from aManifestobject. -
Method Summary
Modifier and TypeMethodDescriptionAdds an entry to this map.Appends all the entries in the specified map to this map.Add if flag istrue .Enables filtering based on a predicate test.Set an inner map in this map to allow for chained get calls.The opposite ofJsonMap.removeAll(String...).Returns a modifiable copy of this map if it's unmodifiable.session(BeanSession session) Override the default bean session used for converting POJOs.setBeanSession(BeanSession value) Sets theBeanSessioncurrently associated with this map.toString()Returns an unmodifiable copy of this map if it's modifiable.Methods inherited from class org.apache.juneau.collections.JsonMap
appendFirst, appendIf, appendIfAbsent, appendIfAbsentIf, asJson, asReadableString, asString, asString, cast, cast, containsKey, containsKeyNotEmpty, containsOuterKey, create, deleteAt, entrySet, exclude, filtered, filteredMap, filteredMap, find, find, findBoolean, findInt, findKeyIgnoreCase, findList, findLong, findMap, findString, get, get, get, getAt, getAt, getBeanSession, getBoolean, getBoolean, getClassMeta, getFirstKey, getInt, getInt, getList, getList, getList, getList, getLong, getLong, getMap, getMap, getMap, getMap, getString, getString, getStringArray, getStringArray, getSwapped, getWithDefault, getWithDefault, getWithDefault, include, isUnmodifiable, keySet, of, of, ofJson, ofJson, ofText, ofText, postAt, put, putAt, putJson, removeAll, removeAll, removeBoolean, removeBoolean, removeInt, removeInt, removeString, removeString, removeWithDefault, writeToMethods inherited from class java.util.LinkedHashMap
clear, containsValue, forEach, getOrDefault, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
ManifestFile
Finds and loads the manifest file of the jar file that the specified class is contained within.- Parameters:
c- The class to get the manifest file of.- Throws:
IOException- If a problem occurred while trying to read the manifest file.
-
ManifestFile
Create an instance of this class from a manifest file on the file system.- Parameters:
f- The manifest file.- Throws:
IOException- If a problem occurred while trying to read the manifest file.
-
ManifestFile
Create an instance of this class loaded from the contents of an input stream.Note that the input must end in a newline to pick up the last line!
- Parameters:
is- The manifest file contents.- Throws:
IOException- If a problem occurred while trying to read the manifest file.
-
ManifestFile
Create an instance of this class from aManifestobject.- Parameters:
f- The manifest to read from.
-
ManifestFile
Create an instance of this class from a manifest path on the file system.- Parameters:
path- The manifest path.- Throws:
IOException- If a problem occurred while trying to read the manifest path.
-
ManifestFile
Create an instance of this class loaded from the contents of a reader.Note that the input must end in a newline to pick up the last line!
- Parameters:
r- The manifest file contents.- Throws:
IOException- If a problem occurred while trying to read the manifest file.
-
-
Method Details
-
append
Description copied from class:JsonMapAppends all the entries in the specified map to this map. -
append
Description copied from class:JsonMapAdds an entry to this map. -
appendIf
Description copied from class:JsonMapAdd if flag istrue . -
filtered
Description copied from class:JsonMapEnables filtering based on a predicate test.If the predicate evaluates to
false on values added to this map, the entry will be skipped. -
inner
Description copied from class:JsonMapSet an inner map in this map to allow for chained get calls.If
JsonMap.get(Object)returnsnull , thenJsonMap.get(Object)will be called on the inner map.In addition to providing the ability to chain maps, this method also provides the ability to wrap an existing map inside another map so that you can add entries to the outer map without affecting the values on the inner map.
JsonMap
map1 = JsonMap.ofJson ("{foo:1}" ); JsonMapmap2 = JsonMap.of ().setInner(map1 );map2 .put("foo" , 2);// Overwrite the entry int foo1 =map1 .getInt("foo" );// foo1 == 1 int foo2 =map2 .getInt("foo" );// foo2 == 2 -
keepAll
Description copied from class:JsonMapThe opposite ofJsonMap.removeAll(String...).Discards all keys from this map that aren't in the specified list.
-
modifiable
Description copied from class:JsonMapReturns a modifiable copy of this map if it's unmodifiable.- Overrides:
modifiablein classJsonMap- Returns:
- A modifiable copy of this map if it's unmodifiable, or this map if it is already modifiable.
-
session
Description copied from class:JsonMapOverride the default bean session used for converting POJOs.Default is
BeanContext.DEFAULT, which is sufficient in most cases.Useful if you're serializing/parsing beans with transforms defined.
-
setBeanSession
Description copied from class:JsonMapSets theBeanSessioncurrently associated with this map.- Overrides:
setBeanSessionin classJsonMap- Parameters:
value- TheBeanSessioncurrently associated with this map.- Returns:
- This object.
-
toString
-
unmodifiable
Description copied from class:JsonMapReturns an unmodifiable copy of this map if it's modifiable.- Overrides:
unmodifiablein classJsonMap- Returns:
- An unmodifiable copy of this map if it's modifiable, or this map if it is already unmodifiable.
-