protected void handleNonConverterProperty()

in src/main/java/com/atlassian/uwc/ui/ConverterEngine.java [660:723]


	protected void handleNonConverterProperty(String converterStr) {
		int equalLoc = converterStr.indexOf("=");
		String key = converterStr.substring(0, equalLoc);
		String value = converterStr.substring(equalLoc + 1);
		String parent = "";
		try {
			if (key.indexOf(NONCONVERTERTYPE_HIERARCHYBUILDER) >= 0) {
				if (isHierarchySwitch(key))
					setHierarchyHandler(value);
				else {
					parent = HierarchyBuilder.class.getName(); 
					Class c;
					c = Class.forName(value);
					HierarchyBuilder hierarchy = (HierarchyBuilder) c.newInstance();
					hierarchyBuilder = hierarchy;
					this.hierarchyBuilder.setProperties(this.miscProperties);
				}
			}
			else if (key.endsWith(NONCONVERTERTYPE_PAGEHISTORYPRESERVATION)) {
				handlePageHistoryProperty(key, value);
			}
			else if (key.endsWith(NONCONVERTERTYPE_ILLEGALHANDLING)) {
				handleIllegalHandling(key, value);
			}
			else if (key.endsWith(NONCONVERTERTYPE_AUTODETECTSPACEKEYS)) {
				handleAutoDetectSpacekeys(key, value);
			}
			else if (key.endsWith(NONCONVERTERTYPE_MISCPROPERTIES)) {
				handleMiscellaneousProperties(key, value);
			}
			else if (key.endsWith(NONCONVERTERTYPE_FILTERS)) {
				parent = FileFilter.class.getName();
				handleFilters(key, value);
			}
			else if (key.endsWith(NONCONVERTERTYPE_XMLEVENT)) {
				handleXmlEvents(key, value);
			}
		} catch (ClassNotFoundException e) { 
			String message = "Property ignored -- the Java class " + value + " was not found";
			log.error(message);
			this.errors.addError(Feedback.BAD_PROPERTY, message, true);
		} catch (IllegalAccessException e) {
			String message = "Property ignored -- there was a problem creating the Java class: " + value +
					".\n" +
					"Note: A necessary method's permissions were too restrictive. Check the constructor. ";
			log.error(message);
			this.errors.addError(Feedback.BAD_PROPERTY, message, true);
		} catch (InstantiationException e) {
			String message = "Property ignored -- there was a problem creating the Java class " + value +
					".\n" +
					"Note: The class cannot be instantiated as it is abstract or is an interface.";
			log.error(message);
			this.errors.addError(Feedback.BAD_PROPERTY, message, true);
		} catch (ClassCastException e) { 
			String message = "Property ignored -- the Java class " + value +
					" must implement the " + parent + " interface!";
			log.error(message);
			this.errors.addError(Feedback.BAD_PROPERTY, message, true);
		} catch (IllegalArgumentException e) {
			String message = "Property ignored -- property value was not in expected format.";
			log.error(message);
			this.errors.addError(Feedback.BAD_PROPERTY, message, true);
		}
	}