Search in sources :

Example 11 with ClassOutline

use of com.sun.tools.xjc.outline.ClassOutline in project midpoint by Evolveum.

the class SchemaProcessor method addComplextType.

private void addComplextType(Outline outline, Map<String, JFieldVar> namespaceFields) {
    Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
    for (Map.Entry<NClass, CClassInfo> entry : set) {
        ClassOutline classOutline = outline.getClazz(entry.getValue());
        QName qname = entry.getValue().getTypeName();
        if (qname == null) {
            continue;
        }
        JFieldVar var = namespaceFields.get(qname.getNamespaceURI());
        if (var != null) {
            createQNameDefinition(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, var, qname);
        } else {
            createPSFField(outline, classOutline.implClass, COMPLEX_TYPE_FIELD_NAME, qname);
        }
    }
}
Also used : ClassOutline(com.sun.tools.xjc.outline.ClassOutline) Entry(java.util.Map.Entry) CClassInfo(com.sun.tools.xjc.model.CClassInfo) NClass(com.sun.tools.xjc.model.nav.NClass) QName(javax.xml.namespace.QName) Map(java.util.Map) HashMap(java.util.HashMap)

Example 12 with ClassOutline

use of com.sun.tools.xjc.outline.ClassOutline in project midpoint by Evolveum.

the class ProcessorUtils method findClassOutline.

public static ClassOutline findClassOutline(Outline outline, QName type) {
    Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
    for (Map.Entry<NClass, CClassInfo> entry : set) {
        ClassOutline classOutline = outline.getClazz(entry.getValue());
        QName qname = entry.getValue().getTypeName();
        if (!type.equals(qname)) {
            continue;
        }
        return classOutline;
    }
    throw new IllegalStateException("Object type class defined by qname '" + type + "' outline was not found.");
}
Also used : ClassOutline(com.sun.tools.xjc.outline.ClassOutline) CClassInfo(com.sun.tools.xjc.model.CClassInfo) NClass(com.sun.tools.xjc.model.nav.NClass) QName(javax.xml.namespace.QName)

Example 13 with ClassOutline

use of com.sun.tools.xjc.outline.ClassOutline in project cxf by apache.

the class DummyXjcPlugin method run.

@Override
public boolean run(Outline arg0, Options arg1, ErrorHandler arg2) {
    for (ClassOutline classOutline : arg0.getClasses()) {
        JDefinedClass implClass = classOutline.implClass;
        JCodeModel codeModel = implClass.owner();
        JMethod dummyMethod = implClass.method(JMod.PUBLIC, codeModel.ref(String.class), "dummy");
        dummyMethod.body()._return(JExpr.lit("dummy"));
    }
    return true;
}
Also used : ClassOutline(com.sun.tools.xjc.outline.ClassOutline) JDefinedClass(com.sun.codemodel.JDefinedClass) JMethod(com.sun.codemodel.JMethod) JCodeModel(com.sun.codemodel.JCodeModel)

Aggregations

ClassOutline (com.sun.tools.xjc.outline.ClassOutline)13 CClassInfo (com.sun.tools.xjc.model.CClassInfo)10 NClass (com.sun.tools.xjc.model.nav.NClass)10 Map (java.util.Map)9 HashMap (java.util.HashMap)8 QName (javax.xml.namespace.QName)8 Entry (java.util.Map.Entry)7 PrismContainerArrayList (com.evolveum.midpoint.prism.xjc.PrismContainerArrayList)3 PrismReferenceArrayList (com.evolveum.midpoint.prism.xjc.PrismReferenceArrayList)3 ArrayList (java.util.ArrayList)3 PrismReferenceValue (com.evolveum.midpoint.prism.PrismReferenceValue)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Containerable (com.evolveum.midpoint.prism.Containerable)1 Objectable (com.evolveum.midpoint.prism.Objectable)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 Referencable (com.evolveum.midpoint.prism.Referencable)1 JCodeModel (com.sun.codemodel.JCodeModel)1 JDefinedClass (com.sun.codemodel.JDefinedClass)1 JMethod (com.sun.codemodel.JMethod)1