@Override public boolean containsValue(Object value) { boolean contains = super.containsValue(value); if (!contains && parent != null) { contains = parent.containsValue(value); } return contains; }
private static Class resolveClass(Properties mappings, Class clazz) throws ClassNotFoundException { // System.out.println("Resolving class: " + clazz.getName()); assert ((mappings != null) && (mappings.size() > 0)); assert (clazz != null); if (mappings.containsKey(clazz.getName())) { return Class.forName(mappings.getProperty(clazz.getName())); } else if (mappings.containsValue(clazz.getName())) { for (Iterator<Entry<Object, Object>> it = mappings.entrySet().iterator(); it.hasNext(); ) { Entry entry = it.next(); if (entry.getValue().equals(clazz.getName())) { return Class.forName(entry.getValue().toString()); } } } else if (mappings.containsKey(trimPackage(clazz.getName()) + ".*")) { String newClass = trimPackage(mappings.getProperty(trimPackage(clazz.getName()) + ".*")) + "." + clazz.getSimpleName(); // System.out.println("Mapped to: " + newClass); return Class.forName(newClass); } else if (mappings.containsValue(trimPackage(clazz.getName()) + ".*")) { for (Iterator<Entry<Object, Object>> it = mappings.entrySet().iterator(); it.hasNext(); ) { Entry entry = it.next(); if (entry.getValue().equals(trimPackage(clazz.getName()) + ".*")) { String newClass = trimPackage(entry.getKey().toString()) + "." + clazz.getSimpleName(); // System.out.println( "Mapped to: "+newClass); return Class.forName(newClass); } } } return null; }
/* * @see org.xml.sax.ContentHandler#startElement(java.lang.String, * java.lang.String, java.lang.String, org.xml.sax.Attributes) */ public void startElement( String in_namespaceURI, String in_localName, String in_qName, Attributes in_atts) throws SAXException { String l_name = in_localName; if (l_name == null || l_name.length() == 0) { l_name = in_qName; } boolean isSetIndex = false; if (_properties.containsValue(l_name)) { for (Iterator l_keys = _properties.keySet().iterator(); l_keys.hasNext(); ) { String l_key = (String) l_keys.next(); if (l_key.startsWith("field") && _properties.getProperty(l_key).equals(l_name)) { _index = Integer.valueOf(l_key.substring(l_key.length() - 1)).intValue(); isSetIndex = true; break; } } } if (!isSetIndex) { _index = -1; } }
public boolean containsValue(Object value) { return p.containsValue(value); }
public boolean existValue(String name) { return p.containsValue("" + name); }
/** * Checks whether the given name is a value in the enum map * * @param name the name * @return <code>true</code> if and only if the given name is a value in the enum map */ public boolean isInEnumMap(String name) { return m_enumMappingProperties.containsValue(name); }
@Override public boolean containsValue(Object value) { // TODO: check if that value exists in one of our GridFields return ctx.containsValue(value); }