Questions tagged [objectfactory]
49 questions
40
votes
2 answers
Objective C : Given a Class id, can I check if this class implements a certain protocol? Or has a certain selector?
I want to use this for an object factory: Given a string, create a Class, and if
this Class supports a protocol (with a Create() method) then alloc the class and call
Create.

Jacko
- 12,665
- 18
- 75
- 126
9
votes
2 answers
What is the ObjectFactory role during JAXB-Unmarshalling?
I'm using JAXB 2.2.2 to parse a simple XML-REST stream. This is the piece of code:
JAXBContext jc = JAXBContext.newInstance( "com.example.entities" );
Unmarshaller u = jc.createUnmarshaller();
r = (Response )u.unmarshal( inputStream…

Marco
- 1,642
- 3
- 16
- 29
7
votes
2 answers
wsimport: multiple wsdl overwrite ObjectFactory
I have multiple (let's say 2, A and B) webservices and I need to generate a client to use them togheter.
In Netbeans I use the wizard "new Web Service Client" passing the two wsdl, looking at the output Netbeans simply call wsimport for each of…

alexroat
- 1,687
- 3
- 23
- 34
6
votes
1 answer
java wsimport rename/different ObjectFactory.java
I'm having problem with wsimport. In one of my wsdl which has to be wsimported I have a complexType with name "objectFactory". Is there any way to tell command wsimport to create while importing different class for maintaining JAXB connections such…

zmeda
- 2,909
- 9
- 36
- 56
6
votes
2 answers
How do I generate multiple .xsd's into the same ObjectFactory?
I need an ObjectFactory with multiple java objects from multiple schemas. I have had 0 luck with several different plugins and variations of those plugins. Currently I am using the following :
org.apache.cxf
…

user2733840
- 61
- 1
- 2
5
votes
1 answer
Get existing container in StructureMap 4.0
I have got a problem with StructureMap 4.0. When working with StructureMap 3.0, I use ObjectFactory to configure all instances and it's very easy to get instance through its own interface anywhere inside the solution. For example:
at the global.cs,…

QuangHao Ta
- 76
- 1
- 3
4
votes
0 answers
Orika - Determining constructor call without registering an ObjectFactory
I need to map two classes with Orika, OrikaA and OrikaB. OrikaB class have a constructor with one parameter that doesn't exist in OrikaA class. To map OrikaA to OrikaB I used a custom ObjectFactory:
public class OrikaA {
String fieldA;
…

Gonzalo García
- 41
- 2
4
votes
1 answer
AngularFire ObjectFactory Childobjects cause Circular Dependency
Using AngularFire, I am extending the object factories in order to have encapsulated data and to allow specific features, as explained in the official tutorial. I have a data structure like the following:
{
'articles': {
…

Micha Schwab
- 786
- 1
- 6
- 21
3
votes
2 answers
StructureMap IOC named instances help
Having a problem with StructureMap IOC. I wish to retrieve different concrete implementations of objects that implement the same interface based on labels or names.
internal static class InstanceHelper
{
internal enum Taxonomy
{
…

Microsoft Developer
- 1,919
- 1
- 20
- 27
3
votes
1 answer
Load external Java method from inside of a XSL stylesheet with JDK internal Xalan and SecurityManager
In our project we currently moved to Java 8 and want to use now the internal XML libraries instead of additional ones.
For that we removed e.g. our xalan.jar from our classpath.
This leads to ClassNotFoundExceptions when trying to render our XML…

Jens
- 53
- 5
3
votes
1 answer
Using custom ObjectFactory with JAXB: is there an established "go to" pattern?
I understand that the ObjectFactory is often automatically generated when working with JAXB as one might define schema and XML first. However, this is not the way I can approach the project.
I have existing code which needs to be annotated and…

Eric Tobias
- 3,225
- 4
- 32
- 50
3
votes
1 answer
How To Use ObjectFactory Generated By Jaxb?
I am using Jaxb to generate Java classes. My schema has the following element defined:

Jan Tacci
- 3,131
- 16
- 63
- 83
2
votes
1 answer
JAXB own object factory not used when unmarshalling
Image you've got auto generated beans and you want to extend them with some extra functionality. So you extend the auto generated beans and in the same file you also extend the ObjectFactory and annotate it with @XmlRegistry.
When unmarshalling some…

Franz Kafka
- 10,623
- 20
- 93
- 149
2
votes
2 answers
Using java generics for a simple factory - How can I avoid these warnings
I'm trying to understand generics properly, and I've written a very simple factory, but I can' see how to get round these two warnings (I've had a good grovel around, but probably I'm not searching with the right terms). Oh! and I don't want to…

pootle
- 507
- 6
- 15
2
votes
3 answers
Can we decide the jaxb class at runtime during unmarshalling?
Is there any way to decide at runtime which java class I would like to Unmarshall the XML into?
I tried in this way Unmarshall code -
public Object unmarshallXml(String xmlReq, String className)
{
String myClass = className+".class";
Object…

Rana
- 505
- 1
- 5
- 19