/** * Metoda vygeneruje polozku pre wrapper pre vlastnosti. * * @return */ private ConfigurationType generateWrapperForProperty() { // Dam si kontextovy vypis cieloveho jazykoveho elementu MappingOfTargetElement target = new MappingOfTargetElement( QNameProcessing.CONTEXT_PRINT, XMLProcessing.ATTRIBUTE, null, TargetNameType.GENERIC, new ElementType[] {ElementType.METHOD}); // Vzhlad - mapovanie na XML MappingOfConfigurationToXML view = new MappingOfConfigurationToXML( "declMethod", "${name}-type", null, XMLProcessing.ELEMENT, 0, 0, -1); // Pre kazdu metodu (rovnaky vysledok pre PER_TARGET v tomto pripade) view.setGeneratingPolicy(GeneratingPolicy.PER_TOP_TARGET); MappingOfConfigurationToXSD type = new MappingOfConfigurationToXSD(TypeOfElement.NONE, null); MappingOfConfigurationToSources source = new MappingOfConfigurationToSources(null, "", SourceType.NONE); ConfigurationType wrapper = new ConfigurationTypeImpl(type, source, view, target, null); wrapper.setMergingPoint(true); return wrapper; }
/** * Metoda vygeneruje polozku pre wrapper pre annotacne typy. * * @return */ private ConfigurationType generateWrapperForType() { MappingOfTargetElement target = new MappingOfTargetElement( QNameProcessing.CONTEXT_PRINT, XMLProcessing.ATTRIBUTE, null, TargetNameType.GENERIC, new ElementType[] {ElementType.ANNOTATION_TYPE}); MappingOfConfigurationToXML view = new MappingOfConfigurationToXML( "annotationType", "${name}-type", null, XMLProcessing.ELEMENT, 0, 0, -1); // Pre kazdu triedu - teda anotacny typ view.setGeneratingPolicy(GeneratingPolicy.PER_TOP_CLASS); MappingOfConfigurationToXSD type = new MappingOfConfigurationToXSD(TypeOfElement.NONE, null); MappingOfConfigurationToSources source = new MappingOfConfigurationToSources(null, "", SourceType.NONE); ConfigurationType wrapper = new ConfigurationTypeImpl(type, source, view, target, null); wrapper.setMergingPoint(true); return wrapper; }