All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pyx4me.maven.j2me.AntPropertyHelper Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
/**
 * Pyx4me framework
 * Copyright (C) 2006-2007 pyx4.com.
 * 
 * @author vlads
 * @version $Id: AntPropertyHelper.java 103 2007-04-21 01:33:52Z vlads $
 */
package com.pyx4me.maven.j2me;

import java.util.Iterator;
import java.util.Map;

import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.apache.tools.ant.PropertyHelper;

public class AntPropertyHelper extends PropertyHelper {

	private Log log;

	private MavenProject mavenProject;

	AntPropertyHelper(MavenProject mavenProject, Log log) {
		this.mavenProject = mavenProject;
		this.log = log;
		if (log.isDebugEnabled()) {
			for (Iterator i = this.mavenProject.getProperties().entrySet()
					.iterator(); i.hasNext();) {
				Map.Entry entry = (Map.Entry) i.next();
				this.log.debug("MavenProject property " + entry.getKey() + "="
						+ entry.getValue());
			}
		}
	}

	public Object getPropertyHook(String ns, String name, boolean user) {
		Object val = this.mavenProject.getProperties().getProperty(name);
		if (val != null) {
			return val;
		}
		return super.getPropertyHook(ns, name, user);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy