ObjectInfo cri =ret.getObjectInfo(); ObjectInfo cricpy = cri!=null? new ObjectInfo(type, cri.getPostProcessor()): new ObjectInfo(type); TypeInfo ti = new TypeInfo(ret.getXMLInfo(), cricpy, ret.getMappingInfo(), ret.getLinkInfo());
/** * Get the post-processor. * @return The post-processor */ public IPostProcessor getPostProcessor() { IPostProcessor ret = objectinfo!=null? objectinfo.getPostProcessor(): null; return ret!=null? ret: getSupertype()!=null? getSupertype().getPostProcessor(): null; }
/** * Get the type info. * @return The type. */ public Object getTypeInfo() { return getObjectInfo()!=null && getObjectInfo().getTypeInfo()!=null ? getObjectInfo().getTypeInfo() : mapinfo!=null && mapinfo.getSupertype()!=null ? mapinfo.getSupertype().getTypeInfo() : null; }
TypeInfo ret = new TypeInfo(xi, oi, mi); return ret;
TypeInfo diatype = new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "BpmnDiagram")}), new ObjectInfo(MBpmnModel.class, new BpmnModelPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"), AccessInfo.IGNORE_READWRITE)), new SubobjectInfo(new AccessInfo("eAnnotations", "annotation")) })); diatype.setReaderHandler(new BeanObjectReaderHandler()); types.add(diatype); types.add(new TypeInfo(new XMLInfo("eAnnotations"), new ObjectInfo(MAnnotation.class), new MappingInfo(null, new BeanAccessInfo[]{ }, types.add(new TypeInfo(new XMLInfo("details"), new ObjectInfo(MAnnotationDetail.class))); types.add(new TypeInfo(new XMLInfo("pools"), new ObjectInfo(MPool.class, new PoolPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("name", "description")), types.add(new TypeInfo(new XMLInfo("artifacts"), new ObjectInfo(MArtifact.class), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("name", "description")), types.add(new TypeInfo(new XMLInfo("associations"), new ObjectInfo(MAssociation.class, new AssociationPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("iD", null, AccessInfo.IGNORE_READWRITE)) types.add(new TypeInfo(new XMLInfo("lanes"), new ObjectInfo(MLane.class, new LanePostProcessor()), new MappingInfo(null, new AttributeInfo[]{
typeinfos.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "capabilities"), new QName(uri, "capability")}), new ObjectInfo(MCapabilityReference.class))); TypeInfo ti_performgoal = new TypeInfo(new XMLInfo(new QName(uri, "performgoal")), new ObjectInfo(MGoal.class, new IPostProcessor() TypeInfo ti_achievegoal = new TypeInfo(new XMLInfo(new QName(uri, "achievegoal")), new ObjectInfo(MGoal.class), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("recalculate", "rebuild")), TypeInfo ti_querygoal = new TypeInfo(new XMLInfo(new QName(uri, "querygoal")), new ObjectInfo(MGoal.class, new IPostProcessor() TypeInfo ti_maintaingoal = new TypeInfo(new XMLInfo(new QName(uri, "maintaingoal")), new ObjectInfo(MGoal.class), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("recalculate", "rebuild")), TypeInfo ti_metagoal = new TypeInfo(new XMLInfo(new QName(uri, "metagoal")), new ObjectInfo(MGoal.class, new GoalMetaProc(true)), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("recalculate", "rebuild")), typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "performgoalref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "achievegoalref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "querygoalref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "maintaingoalref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "metagoalgoalref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "messageeventref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "internaleventref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "expressionref")), new ObjectInfo(MElementRef.class), null, null)); typeinfos.add(new TypeInfo(new XMLInfo(new QName(uri, "conditionref")), new ObjectInfo(MElementRef.class), null, null));
if(comptype==null && ti.getXMLInfo().getXMLPath().equals(new XMLInfo(new QName(uri, "componenttype")).getXMLPath())) if(configtype==null && ti.getXMLInfo().getXMLPath().equals(new XMLInfo(new QName(uri, "configuration")).getXMLPath())) types.add(new TypeInfo(new XMLInfo(new QName(uri, "applicationtype")), new ObjectInfo(ApplicationModelInfo.class, appproc), new MappingInfo(comptype))); types.add(new TypeInfo(new XMLInfo(new QName(uri, "application")), new ObjectInfo(ApplicationConfigurationInfo.class), new MappingInfo(configtype))); types.add(new TypeInfo(new XMLInfo(new QName(uri, "configuration")), new ObjectInfo(ApplicationConfigurationInfo.class), new MappingInfo(configtype))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "applicationtype"), new QName(uri, "arguments"), new QName(uri, "argument")}), new ObjectInfo(Argument.class, new ExpressionProcessor()), new MappingInfo(null, "description", "value", new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "applicationtype"), new QName(uri, "arguments"), new QName(uri, "result")}), new ObjectInfo(Argument.class, new ExpressionProcessor()), new MappingInfo(null, "description", "value", new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "application"), new QName(uri, "arguments"), new QName(uri, "argument")}), new ObjectInfo(UnparsedExpression.class),//, new ExpressionProcessor()), new MappingInfo(null, null, "value", new AttributeInfo[]{ new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))
/** * Get the post-processor. * @return The post-processor */ public IPostProcessor[] getPostProcessors(Object object, Object typeinfo) { IPostProcessor pp = typeinfo instanceof TypeInfo? ((TypeInfo)typeinfo).getPostProcessor(): null; return pp==null? null: new IPostProcessor[]{pp}; }
/** * Add a typeinfo. */ public synchronized void addTypeInfo(TypeInfo typeinfo) { if(typeinfos==null) typeinfos = new HashMap(); // System.out.println("added typeinfo: "+typeinfo+" "+typeinfo.getTypeInfo()); // TypeInfo mapinfo = (TypeInfo)it.next(); TreeSet maps = (TreeSet)typeinfos.get(typeinfo.getTypeInfo()); if(maps==null) { maps = new TreeSet(new AbstractInfo.SpecificityComparator()); typeinfos.put(typeinfo.getTypeInfo(), maps); } maps.add(typeinfo); }
Object ti = ((TypeInfo)type).getTypeInfo(); if(ti instanceof Class && ((Class)ti).isInterface()) type = ((TypeInfo)type).getXMLTag();
tag = typeinfo.getXMLTag(); if(typeinfo.getXMLInfo()!=null) path = typeinfo.getXMLInfo().getXMLPathElements();
/** * Get the objectinfo. * @return The objectinfo. */ public ObjectInfo getObjectInfo() { return objectinfo!=null ? objectinfo : mapinfo!=null && mapinfo.getSupertype()!=null ? mapinfo.getSupertype().getObjectInfo() : null; }
/** * Get the XML mapping. */ public static Set<Object> getXMLMapping() { Set types = new HashSet(); String uri = "http://www.activecomponents.org/jadex-agrspace"; types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "agrspacetype")}), new ObjectInfo(MAGRSpaceType.class))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "grouptype")}), new ObjectInfo(MGroupType.class))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "role")}), new ObjectInfo(MRoleType.class))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "agrspace")}), new ObjectInfo(MAGRSpaceInstance.class), new MappingInfo(null, new AttributeInfo[]{new AttributeInfo(new AccessInfo("type", "typeName"))}))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "group")}), new ObjectInfo(MGroupInstance.class), new MappingInfo(null, new AttributeInfo[]{new AttributeInfo(new AccessInfo("type", "typeName"))}, null))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "position")}), new ObjectInfo(MPosition.class), new MappingInfo(null, new AttributeInfo[]{new AttributeInfo(new AccessInfo("componenttype", "componentType")), new AttributeInfo(new AccessInfo("role", "roleType"))}, null))); return types; } }
TypeInfo diatype = new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "BpmnDiagram")}), new ObjectInfo(MBpmnModel.class, new BpmnModelPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"), AccessInfo.IGNORE_READWRITE)), new SubobjectInfo(new AccessInfo("eAnnotations", "annotation")) })); diatype.setReaderHandler(new BeanObjectReaderHandler()); types.add(diatype); types.add(new TypeInfo(new XMLInfo("eAnnotations"), new ObjectInfo(MAnnotation.class), new MappingInfo(null, new BeanAccessInfo[]{ }, types.add(new TypeInfo(new XMLInfo("details"), new ObjectInfo(MAnnotationDetail.class))); types.add(new TypeInfo(new XMLInfo("pools"), new ObjectInfo(MPool.class, new PoolPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("name", "description")), types.add(new TypeInfo(new XMLInfo("artifacts"), new ObjectInfo(MArtifact.class), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("name", "description")), types.add(new TypeInfo(new XMLInfo("associations"), new ObjectInfo(MAssociation.class, new AssociationPostProcessor()), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("iD", null, AccessInfo.IGNORE_READWRITE)) types.add(new TypeInfo(new XMLInfo("lanes"), new ObjectInfo(MLane.class, new LanePostProcessor()), new MappingInfo(null, new AttributeInfo[]{
/** * Get the post-processor. * @return The post-processor */ public IPostProcessor[] getPostProcessors(Object object, Object typeinfo) { IPostProcessor pp = typeinfo instanceof TypeInfo? ((TypeInfo)typeinfo).getPostProcessor(): null; return pp==null? null: new IPostProcessor[]{pp}; }
type = ((TypeInfo)type).getTypeInfo();
TypeInfo ti_color = new TypeInfo(new XMLInfo(new QName[] { new QName(SXML.PROTOCOL_TYPEINFO + "java.awt", "Color") }), null, new MappingInfo(null, null, new AttributeInfo(new AccessInfo((String) null, AccessInfo.THIS), new AttributeConverter(coconv, null)))); TypeInfo ti_image = new TypeInfo(new XMLInfo(new QName[] { new QName(SXML.PROTOCOL_TYPEINFO + "java.awt.image", "Image") }), new ObjectInfo(new IBeanObjectCreator() TypeInfo ti_rect = new TypeInfo(new XMLInfo(new QName[] { new QName(SXML.PROTOCOL_TYPEINFO + "java.awt", "Rectangle") }), new ObjectInfo(new IBeanObjectCreator()
ObjectInfo cri =ret.getObjectInfo(); ObjectInfo cricpy = cri!=null? new ObjectInfo(type, cri.getPostProcessor()): new ObjectInfo(type); TypeInfo ti = new TypeInfo(ret.getXMLInfo(), cricpy, ret.getMappingInfo(), ret.getLinkInfo());
TypeInfo apptype = new TypeInfo(new XMLInfo(new QName(uri, "applicationtype")), new ObjectInfo(ModelInfo.class), new MappingInfo(null, "description", null, new AttributeInfo[]{ new SubobjectInfo(new XMLInfo(new QName[]{new QName(uri, "applications"), new QName(uri, "application")}), new AccessInfo(new QName(uri, "configuration"), "configuration", null, null))//, new BeanAccessInfo(putprop, null, "map", getname))), })); apptype.setReaderHandler(new BeanObjectReaderHandler()); types.add(apptype); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "applicationtype"), new QName(uri, "arguments"), new QName(uri, "argument")}), new ObjectInfo(Argument.class, new ExpressionProcessor()), new MappingInfo(null, "description", "value", new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "applicationtype"), new QName(uri, "arguments"), new QName(uri, "result")}), new ObjectInfo(Argument.class, new ExpressionProcessor()), new MappingInfo(null, "description", "value", new AttributeInfo[]{new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))}, null))); types.add(new TypeInfo(new XMLInfo(new QName(uri, "application")), new ObjectInfo(ConfigurationInfo.class), new MappingInfo(null, new AttributeInfo[]{ new AttributeInfo(new AccessInfo("type", "typeName")), }))); types.add(new TypeInfo(new XMLInfo(new QName[]{new QName(uri, "application"), new QName(uri, "arguments"), new QName(uri, "argument")}), new ObjectInfo(UnparsedExpression.class),//, new ExpressionProcessor()), new MappingInfo(null, null, "value", new AttributeInfo[]{ new AttributeInfo(new AccessInfo("class", "clazz"), new AttributeConverter(classconv, reclassconv))
/** * Get the post-processor. * @return The post-processor */ public synchronized IPostProcessor[] getPostProcessors(Object object, Object typeinfo) { List<IPostProcessor> ret = new ArrayList<IPostProcessor>(); IPostProcessor tiproc = typeinfo instanceof TypeInfo? ((TypeInfo)typeinfo).getPostProcessor(): null; if(tiproc!=null) ret.add(tiproc); if(postprocessors!=null) { for(Iterator<IFilter> it = postprocessors.keySet().iterator(); it.hasNext(); ) { IFilter fil = it.next(); if(fil.filter(object)) { ret.add(postprocessors.get(fil)); } } } return ret.toArray(new IPostProcessor[ret.size()]); }