/** * Get the classname of the definition. * @return the name of the class of this definition. */ @Override public String getClassName() { return parent.getClassName(); }
/** * update the restricted definition table with a new or * modified definition. */ private void updateRestrictedDefinition(AntTypeDefinition def) { String name = def.getName(); List<AntTypeDefinition> list = null; synchronized (restrictedDefinitions) { list = restrictedDefinitions.computeIfAbsent(name, k -> new ArrayList<>()); } // Check if the classname is already present and remove it // if it is synchronized (list) { for (Iterator<AntTypeDefinition> i = list.iterator(); i.hasNext();) { AntTypeDefinition current = i.next(); if (current.getClassName().equals(def.getClassName())) { i.remove(); break; } } list.add(def); } }
/** * Returns a description of the type of the given element. * <p> * This is useful for logging purposes. * * @param o The element to describe. * Must not be <code>null</code>. * @param brief whether to use a brief description. * @return a description of the element type. * * @since Ant 1.7 */ public String getElementName(Object o, boolean brief) { // PR: I do not know what to do if the object class // has multiple defines // but this is for logging only... Class<?> elementClass = o.getClass(); String elementClassname = elementClass.getName(); synchronized (antTypeTable) { for (AntTypeDefinition def : antTypeTable.values()) { if (elementClassname.equals(def.getClassName()) && (elementClass == def.getExposedClass(project))) { String name = def.getName(); return brief ? name : "The <" + name + "> type"; } } } return getUnmappedElementName(o.getClass(), brief); }
} else { final String classname = def.getClassName(); antTask = classname.startsWith("org.apache.tools.ant."); boolean optional = classname.startsWith("org.apache.tools.ant.taskdefs.optional");
if (other == null || getClass() != other.getClass() || !getClassName().equals(other.getClassName()) || !extractClassname(adapterClass).equals( extractClassname(other.adapterClass))
/** * Update the component definition table with a new or * modified definition. * @param def the definition to update or insert. */ private void updateDataTypeDefinition(AntTypeDefinition def) { String name = def.getName(); synchronized (antTypeTable) { rebuildTaskClassDefinitions = true; rebuildTypeClassDefinitions = true; final AntTypeDefinition old = antTypeTable.get(name); if (old != null) { if (sameDefinition(def, old)) { return; } Class<?> oldClass = old.getExposedClass(project); boolean isTask = oldClass != null && Task.class.isAssignableFrom(oldClass); project.log("Trying to override old definition of " + (isTask ? "task " : "datatype ") + name, (def.similarDefinition(old, project)) ? Project.MSG_VERBOSE : Project.MSG_WARN); } project.log(" +Datatype " + name + " " + def.getClassName(), Project.MSG_DEBUG); antTypeTable.put(name, def); } }
private String getTaskTypePart(AntTaskNode node) { AntProjectNode projectNode = node.getProjectNode(); if (projectNode != null) { Project antProject = projectNode.getProject(); AntTypeDefinition definition = ComponentHelper.getComponentHelper(antProject).getDefinition(node.getTask().getTaskName()); if (definition == null) { return null; } String className = definition.getClassName(); if (className.indexOf("taskdef") != -1) { //$NON-NLS-1$ return "Tasks"; //$NON-NLS-1$ } return "Types"; //$NON-NLS-1$ } return null; } }
AntTypeDefinition taskClass = getTaskClass(taskName); if (taskClass != null) { if (MACROINSTANCE_NAME.equals(taskClass.getClassName())) { addMacroDefAttributeProposals(taskName, prefix, proposals); } else {
if (MACROINSTANCE_NAME.equals(taskClass.getClassName())) { currentProposalMode = PROPOSAL_MODE_ATTRIBUTE_PROPOSAL; addMacroDefElementProposals(parentName, prefix, proposals);