Class StaticFieldLoadStreamFactory

  • All Implemented Interfaces:
    StreamFactory

    public class StaticFieldLoadStreamFactory
    extends java.lang.Object
    implements StreamFactory
    Stream factory for streams created by loading a value from a static field. This is mainly to handle System.in, System.out, and System.err.
    • Constructor Summary

      Constructors 
      Constructor Description
      StaticFieldLoadStreamFactory​(java.lang.String streamBaseClass, java.lang.String className, java.lang.String fieldName, java.lang.String fieldSig)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Stream createStream​(Location location, org.apache.bcel.generic.ObjectType type, org.apache.bcel.generic.ConstantPoolGen cpg, RepositoryLookupFailureCallback lookupFailureCallback)
      Determine if a Stream is created at given location.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • streamBaseClass

        public java.lang.String streamBaseClass
      • className

        public java.lang.String className
      • fieldName

        public java.lang.String fieldName
      • fieldSig

        public java.lang.String fieldSig
    • Constructor Detail

      • StaticFieldLoadStreamFactory

        public StaticFieldLoadStreamFactory​(java.lang.String streamBaseClass,
                                            java.lang.String className,
                                            java.lang.String fieldName,
                                            java.lang.String fieldSig)
        Constructor. Created Stream objects will be marked as uninteresting.
        Parameters:
        streamBaseClass - the base class of the stream objects created by the factory
        className - name of the class containing the static field
        fieldName - name of the static field
        fieldSig - signature of the static field
    • Method Detail

      • createStream

        public Stream createStream​(Location location,
                                   org.apache.bcel.generic.ObjectType type,
                                   org.apache.bcel.generic.ConstantPoolGen cpg,
                                   RepositoryLookupFailureCallback lookupFailureCallback)
        Description copied from interface: StreamFactory
        Determine if a Stream is created at given location.
        Specified by:
        createStream in interface StreamFactory
        Parameters:
        location - the Location
        type - the ObjectType associated with the instruction at the location; the StreamResourceTracker prescreens for TypedInstructions that are associated with ObjectTypes, since they are the only instructions that could conceivably create a stream object
        cpg - the ConstantPoolGen for the method
        lookupFailureCallback - used to report missing classes in the class hierarchy
        Returns:
        a Stream created at the Location, or null if no stream is created there