java - Injecting factory class to other beans -
i have factory class , wonder if possible inject animalmapper
factory class other beans needs it?
animalmapper factory class
public static mapper create(final string type) { if (type.equalsignorecase("dog")) { return new dogmapper(); } else if (type.equalsignorecase("cat")) { return new catmapper(); } ... }
currently using animalmapper.create(...)
here sample code
public class testclass{ //member variable defination. @inject animalmapper animalmapper; //defining mapper instance }
i not sure if looking if can clarify question more can add more details.
Comments
Post a Comment