Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
---|---|---|
5,500 |
void (AntDomTypeDef typedef) { visitAntDomElement(typedef); }
|
visitTypeDef
|
5,501 |
void (AntDomTaskdef typedef) { visitTypeDef(typedef); }
|
visitTaskDef
|
5,502 |
void (AntDomMacroDef macrodef) { visitAntDomElement(macrodef); }
|
visitMacroDef
|
5,503 |
void (AntDomPresetDef presetdef) { visitAntDomElement(presetdef); }
|
visitPresetDef
|
5,504 |
void (AntDomScriptDef scriptdef) { visitAntDomElement(scriptdef); }
|
visitScriptDef
|
5,505 |
void (AntDomTarget target) { visitAntDomElement(target); }
|
visitTarget
|
5,506 |
void (AntDomProject project) { visitAntDomElement(project); }
|
visitProject
|
5,507 |
void (AntDomProperty property) { visitAntDomElement(property); }
|
visitProperty
|
5,508 |
void (AntDomInclude includeTag) { visitAntDomElement(includeTag); }
|
visitInclude
|
5,509 |
void (AntDomImport importTag) { visitAntDomElement(importTag); }
|
visitImport
|
5,510 |
void (AntDomAntCall antCall) { visitAntDomElement(antCall); }
|
visitAntDomAntCall
|
5,511 |
void (AntDomAntCallParam antCallParam) { visitAntDomElement(antCallParam); }
|
visitAntDomAntCallParam
|
5,512 |
ClassLoader () { ClassLoader loader = myCachedLoader; if (loader == null) { myCachedLoader = loader = CustomAntElementsRegistry.createClassLoader(CustomAntElementsRegistry.collectUrls(this), getContextAntProject()); } return loader; }
|
getClassLoader
|
5,513 |
AntDomElement (@Nullable @NonNls String s, ConvertContext context) { if (s != null) { final AntDomElement element = AntSupport.getInvocationAntDomElement(context); if (element != null) { return findElementById(element.getContextAntProject(), s, CustomAntElementsRegistry.ourIsBuildingClasspathForCustomTagLoading.get()); } } return null; }
|
fromString
|
5,514 |
String (@Nullable AntDomElement antDomElement, ConvertContext context) { return antDomElement != null? antDomElement.getId().getRawText() : null; }
|
toString
|
5,515 |
PsiElement () { final AntDomElement value = genericDomValue.getValue(); if (value == null) { return null; } final DomTarget target = DomTarget.getTarget(value, value.getId()); if (target == null) { return null; } return PomService.convertToPsi(element.getProject(), target); }
|
resolve
|
5,516 |
void (AntDomElement element) { final String variant = element.getId().getRawText(); if (variant != null) { variants.add(variant); } super.visitAntDomElement(element); }
|
visitAntDomElement
|
5,517 |
String () { return AntBundle.message("cannot.resolve.refid", getCanonicalText()); }
|
getUnresolvedMessagePattern
|
5,518 |
AntDomElement (AntDomElement from, final String id, final boolean skipCustomTags) { if (id.equals(from.getId().getRawText())) { return from; } final Ref<AntDomElement> result = new Ref<>(null); from.accept(new AntDomRecursiveVisitor() { @Override public void visitAntDomCustomElement(AntDomCustomElement custom) { if (!skipCustomTags) { super.visitAntDomCustomElement(custom); } } @Override public void visitAntDomElement(AntDomElement element) { if (result.get() != null) { return; } if (id.equals(element.getId().getRawText())) { result.set(element); return; } super.visitAntDomElement(element); } }); return result.get(); }
|
findElementById
|
5,519 |
void (AntDomCustomElement custom) { if (!skipCustomTags) { super.visitAntDomCustomElement(custom); } }
|
visitAntDomCustomElement
|
5,520 |
void (AntDomElement element) { if (result.get() != null) { return; } if (id.equals(element.getId().getRawText())) { result.set(element); return; } super.visitAntDomElement(element); }
|
visitAntDomElement
|
5,521 |
void (@NotNull XmlAttributeValue element, final Collection<? super PsiReference> refs) { final DomElement domElement = DomUtil.getDomElement(element); if (domElement == null) { return; } final AntDomMacroDef macrodef = domElement.getParentOfType(AntDomMacroDef.class, true); if (macrodef == null) { return; } final String text = ElementManipulators.getValueText(element); final int valueBeginingOffset = Math.abs(element.getTextRange().getStartOffset() - element.getValueTextRange().getStartOffset()); int startIndex; int endIndex = -1; while ((startIndex = text.indexOf("@{", endIndex + 1)) > endIndex) { startIndex += 2; endIndex = startIndex; int nestedBrackets = 0; while (text.length() > endIndex) { final char ch = text.charAt(endIndex); if (ch == '}') { if (nestedBrackets == 0) { break; } --nestedBrackets; } else if (ch == '{') { ++nestedBrackets; } ++endIndex; } if(nestedBrackets > 0 || endIndex == text.length()) return; if (endIndex >= startIndex) { //final String name = text.substring(startIndex, endIndex); refs.add(new AntDomMacrodefAttributeReference(element, new TextRange(valueBeginingOffset + startIndex, valueBeginingOffset + endIndex))); } endIndex = startIndex; } } }
|
addMacrodefParameterRefs
|
5,522 |
PsiElement () { return ResolveCache.getInstance(getElement().getProject()).resolveWithCaching(this, MyResolver.INSTANCE, false, false); }
|
resolve
|
5,523 |
AntDomElement () { final DomElement selfElement = DomUtil.getDomElement(getElement()); if (selfElement == null) { return null; } return selfElement.getParentOfType(AntDomElement.class, false); }
|
getHostingAntDomElement
|
5,524 |
Set<String> () { final AntDomElement hostingElement = getHostingAntDomElement(); if (hostingElement == null) { return Collections.emptySet(); } final AntDomTarget contextTarget = hostingElement.getParentOfType(AntDomTarget.class, false); if (contextTarget == null) { return Collections.emptySet(); } final Set<String> existing = new ArrayListSet<>(); final String selfName = contextTarget.getName().getStringValue(); if (selfName != null) { existing.add(selfName); } final String dependsString = contextTarget.getDependsList().getRawText(); if (dependsString != null) { final StringTokenizer tokenizer = new StringTokenizer(dependsString, ",", false); while (tokenizer.hasMoreTokens()) { existing.add(tokenizer.nextToken().trim()); } } return existing; }
|
getExistingNames
|
5,525 |
String () { return AntBundle.message("cannot.resolve.target", getCanonicalText()); }
|
getUnresolvedMessagePattern
|
5,526 |
PsiElement (@NotNull PsiReference psiReference, boolean incompleteCode) { final TargetResolver.Result result = ((AntDomTargetReference)psiReference).doResolve(psiReference.getCanonicalText()); if (result == null) { return null; } final Pair<AntDomTarget,String> pair = result.getResolvedTarget(psiReference.getCanonicalText()); final DomTarget domTarget = pair != null && pair.getFirst() != null ? DomTarget.getTarget(pair.getFirst()) : null; return domTarget != null? PomService.convertToPsi(domTarget) : null; }
|
resolve
|
5,527 |
void (AntDomTargetReference ref) { myRefs.add(ref); }
|
addReference
|
5,528 |
void (AntDomTargetReference ref, String newText) { Integer lengthDelta = null; for (AntDomTargetReference r : myRefs) { if (lengthDelta != null) { r.setRangeInElement(r.getRangeInElement().shiftRight(lengthDelta)); } else if (r.equals(ref)) { final TextRange range = r.getRangeInElement(); final int oldLength = range.getLength(); lengthDelta = Integer.valueOf(newText.length() - oldLength); r.setRangeInElement(range.grown(lengthDelta)); } } }
|
textChanged
|
5,529 |
void (@NotNull final AntDomElement antDomElement, @NotNull DomExtensionsRegistrar registrar) { final XmlElement xmlElement = antDomElement.getXmlElement(); if (xmlElement instanceof XmlTag xmlTag) { final String tagName = xmlTag.getName(); final AntDomProject antProject = antDomElement.getAntProject(); if (antProject == null) { return; } final ReflectedProject reflected = ReflectedProject.getProject(antProject.getClassLoader()); if (reflected.getProject() == null) { return; } final DomGenericInfo genericInfo = antDomElement.getGenericInfo(); AntIntrospector classBasedIntrospector = null; final Map<String,Class<?>> coreTaskDefs = reflected.getTaskDefinitions(); final Map<String, Class<?>> coreTypeDefs = reflected.getDataTypeDefinitions(); final boolean isCustom = antDomElement instanceof AntDomCustomElement; if ("project".equals(tagName)) { classBasedIntrospector = getIntrospector(reflected.getProject().getClass()); } else if ("target".equals(tagName)) { classBasedIntrospector = getIntrospector(reflected.getTargetClass()); } else { if (isCustom) { final AntDomCustomElement custom = (AntDomCustomElement)antDomElement; final Class definitionClass = custom.getDefinitionClass(); if (definitionClass != null) { classBasedIntrospector = getIntrospector(definitionClass); } } else { Class elemType = antDomElement.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY); if (elemType == null) { if (coreTaskDefs != null){ elemType = coreTaskDefs.get(tagName); } } if (elemType == null) { if (coreTypeDefs != null){ elemType = coreTypeDefs.get(tagName); } } if (elemType != null) { classBasedIntrospector = getIntrospector(elemType); } } } AbstractIntrospector parentIntrospector = null; if (classBasedIntrospector != null) { parentIntrospector = new ClassIntrospectorAdapter(classBasedIntrospector, coreTaskDefs, coreTypeDefs, reflected.getRestrictedDefinitions()); } else { if (isCustom) { final AntDomNamedElement declaringElement = ((AntDomCustomElement)antDomElement).getDeclaringElement(); if (declaringElement instanceof AntDomMacroDef) { parentIntrospector = new MacrodefIntrospectorAdapter((AntDomMacroDef)declaringElement); } else if (declaringElement instanceof AntDomMacrodefElement){ parentIntrospector = new MacrodefElementOccurrenceIntrospectorAdapter((AntDomMacrodefElement)declaringElement)/*ContainerElementIntrospector.INSTANCE*/; } else if (declaringElement instanceof AntDomScriptDef) { parentIntrospector = new ScriptdefIntrospectorAdapter((AntDomScriptDef)declaringElement); } } } if (parentIntrospector != null) { defineAttributes(xmlTag, registrar, genericInfo, parentIntrospector); if ("project".equals(tagName) || parentIntrospector.isContainer()) { // can contain any task or/and type definition if (coreTaskDefs != null) { for (Map.Entry<String, Class<?>> entry : coreTaskDefs.entrySet()) { final DomExtension extension = registerChild(registrar, genericInfo, entry.getKey()); if (extension != null) { final Class type = entry.getValue(); if (type != null) { extension.putUserData(ELEMENT_IMPL_CLASS_KEY, type); } extension.putUserData(AntDomElement.ROLE, AntDomElement.Role.TASK); } } } if (coreTypeDefs != null) { for (Map.Entry<String, Class<?>> entry : coreTypeDefs.entrySet()) { final DomExtension extension = registerChild(registrar, genericInfo, entry.getKey()); if (extension != null) { final Class type = entry.getValue(); if (type != null) { extension.putUserData(ELEMENT_IMPL_CLASS_KEY, type); } extension.putUserData(AntDomElement.ROLE, AntDomElement.Role.DATA_TYPE); } } } } else { final Iterator<String> nested = parentIntrospector.getNestedElementsIterator(); while (nested.hasNext()) { final String nestedElementName = nested.next(); final DomExtension extension = registerChild(registrar, genericInfo, nestedElementName); if (extension != null) { Class type = parentIntrospector.getNestedElementType(nestedElementName); if (type != null && CommonClassNames.JAVA_LANG_OBJECT.equals(type.getName())) { type = null; // hack to support badly written tasks } if (type == null) { if (coreTypeDefs != null){ type = coreTypeDefs.get(nestedElementName); } } if (type != null) { extension.putUserData(ELEMENT_IMPL_CLASS_KEY, type); } AntDomElement.Role role = AntDomElement.Role.DATA_TYPE; if (coreTaskDefs != null && coreTaskDefs.containsKey(nestedElementName) || type != null && isAssignableFrom(Task.class.getName(), type)) { role = AntDomElement.Role.TASK; } extension.putUserData(AntDomElement.ROLE, role); } } } registrar.registerCustomChildrenExtension(AntDomCustomElement.class, new AntCustomTagNameDescriptor()); } } }
|
registerExtensions
|
5,530 |
void (XmlTag xmlTag, DomExtensionsRegistrar registrar, DomGenericInfo genericInfo, AbstractIntrospector parentIntrospector) { final Map<String, Pair<Type, Class<?>>> registeredAttribs = getStaticallyRegisteredAttributes(genericInfo); // define attributes discovered by introspector and not yet defined statically final Iterator<String> introspectedAttributes = parentIntrospector.getAttributesIterator(); while (introspectedAttributes.hasNext()) { final String attribName = introspectedAttributes.next(); if (genericInfo.getAttributeChildDescription(attribName) == null) { // if not defined yet final String _attribName = StringUtil.toLowerCase(attribName); final Pair<Type, Class<?>> types = registeredAttribs.get(_attribName); Type type = Pair.getFirst(types); Class<?> converterClass = Pair.getSecond(types); if (type == null) { type = String.class; // use String by default final Class attributeType = parentIntrospector.getAttributeType(attribName); if (attributeType != null) { // handle well-known types if (File.class.isAssignableFrom(attributeType)) { type = PsiFileSystemItem.class; converterClass = AntPathConverter.class; } else if (Boolean.class.isAssignableFrom(attributeType)){ type = Boolean.class; converterClass = AntBooleanConverter.class; } else if (isAssignableFrom(Reference.class.getName(), attributeType)) { converterClass = AntDomRefIdConverter.class; } } } registerAttribute(registrar, attribName, type, converterClass); if (types == null) { // augment the map if this was a newly added attribute registeredAttribs.put(_attribName, new Pair<>(type, converterClass)); } } } // handle attribute case problems: // additionaly register all attributes that exist in XML but differ from the registered ones only in case for (XmlAttribute xmlAttribute : xmlTag.getAttributes()) { final String existingAttribName = xmlAttribute.getName(); if (genericInfo.getAttributeChildDescription(existingAttribName) == null) { final Pair<Type, Class<?>> pair = registeredAttribs.get(StringUtil.toLowerCase(existingAttribName)); if (pair != null) { // if such attribute should actually be here registerAttribute(registrar, existingAttribName, pair.getFirst(), pair.getSecond()); } } } }
|
defineAttributes
|
5,531 |
void (DomExtensionsRegistrar registrar, String attribName, final @NotNull Type attributeType, final @Nullable Class converterType) { final DomExtension extension = registrar.registerGenericAttributeValueChildExtension(new XmlName(attribName), attributeType); if (converterType != null) { try { extension.setConverter((Converter<?>)converterType.newInstance()); } catch (InstantiationException | IllegalAccessException e) { LOG.info(e); } } }
|
registerAttribute
|
5,532 |
DomExtension (DomExtensionsRegistrar registrar, DomGenericInfo elementInfo, String childName) { if (elementInfo.getCollectionChildDescription(childName) == null) { // register if not yet defined statically Class<? extends AntDomElement> modelClass = getModelClass(childName); if (modelClass == null) { modelClass = AntDomElement.class; } return registrar.registerCollectionChildrenExtension(new XmlName(childName), modelClass); } return null; }
|
registerChild
|
5,533 |
AntIntrospector (Class c) { try { return AntIntrospector.getInstance(c); } catch (Throwable ignored) { } return null; }
|
getIntrospector
|
5,534 |
boolean (final String baseClassName, final Class clazz) { try { final ClassLoader loader = clazz.getClassLoader(); if (loader != null) { final Class<?> baseClass = loader.loadClass(baseClassName); return baseClass.isAssignableFrom(clazz); } } catch (ClassNotFoundException ignored) { } return false; }
|
isAssignableFrom
|
5,535 |
Set<EvaluatedXmlName> (@NotNull DomElement parent) { if (!(parent instanceof AntDomElement element)) { return Collections.emptySet(); } final AntDomProject antDomProject = element.getAntProject(); if (antDomProject == null) { return Collections.emptySet(); } final CustomAntElementsRegistry registry = CustomAntElementsRegistry.getInstance(antDomProject); final Set<EvaluatedXmlName> result = new HashSet<>(); for (XmlName variant : registry.getCompletionVariants(element)) { final String ns = variant.getNamespaceKey(); result.add(new DummyEvaluatedXmlName(variant, ns != null? ns : "")); } return result; }
|
getCompletionVariants
|
5,536 |
PomTarget (DomElement parent, @NotNull EvaluatedXmlName name) { final XmlName xmlName = name.getXmlName(); return doFindDeclaration(parent, xmlName); }
|
findDeclaration
|
5,537 |
PomTarget (@NotNull DomElement child) { XmlName name = new XmlName(child.getXmlElementName(), child.getXmlElementNamespace()); return doFindDeclaration(child.getParent(), name); }
|
findDeclaration
|
5,538 |
PomTarget (DomElement parent, XmlName xmlName) { if (!(parent instanceof AntDomElement parentElement)) { return null; } final AntDomProject antDomProject = parentElement.getAntProject(); if (antDomProject == null) { return null; } final CustomAntElementsRegistry registry = CustomAntElementsRegistry.getInstance(antDomProject); final AntDomElement declaringElement = registry.findDeclaringElement(parentElement, xmlName); if (declaringElement == null) { return null; } DomTarget target = DomTarget.getTarget(declaringElement); if (target == null && declaringElement instanceof AntDomTypeDef typedef) { final GenericAttributeValue<PsiFileSystemItem> resource = typedef.getResource(); if (resource != null) { target = DomTarget.getTarget(declaringElement, resource); } if (target == null) { final GenericAttributeValue<PsiFileSystemItem> file = typedef.getFile(); if (file != null) { target = DomTarget.getTarget(declaringElement, file); } } } return target; }
|
doFindDeclaration
|
5,539 |
Iterator<String> () { return Collections.emptyIterator(); }
|
getAttributesIterator
|
5,540 |
Iterator<String> () { return Collections.emptyIterator(); }
|
getNestedElementsIterator
|
5,541 |
Class (String attribName) { return null; }
|
getAttributeType
|
5,542 |
Class (String elementName) { return null; }
|
getNestedElementType
|
5,543 |
Iterator<String> () { return new EnumerationToIteratorAdapter<>(myIntrospector.getAttributes()); }
|
getAttributesIterator
|
5,544 |
Class (String attribName) { return myIntrospector.getAttributeType(attribName); }
|
getAttributeType
|
5,545 |
boolean () { return myIntrospector.isContainer(); }
|
isContainer
|
5,546 |
Iterator<String> () { initNestedElements(); return myNestedElements.iterator(); }
|
getNestedElementsIterator
|
5,547 |
Class (String attribName) { initNestedElements(); return myNestedElementTypes.get(attribName); }
|
getNestedElementType
|
5,548 |
void () { if (myNestedElements != null) { return; } myNestedElements = new ArrayList<>(); myNestedElementTypes = new HashMap<>(); final Enumeration<String> nestedElements = myIntrospector.getNestedElements(); while (nestedElements.hasMoreElements()) { final String elemName = nestedElements.nextElement(); myNestedElements.add(elemName); myNestedElementTypes.put(elemName, myIntrospector.getElementType(elemName)); } final Set<String> extensionPointTypes = myIntrospector.getExtensionPointTypes(); for (String extPoint : extensionPointTypes) { processEntries(extPoint, myCoreTaskDefs); processEntries(extPoint, myCoreTypeDefs); processRestrictedTypeDefinitions(extPoint); } }
|
initNestedElements
|
5,549 |
void (String extPoint, Map<String, Class<?>> definitions) { for (Map.Entry<String, Class<?>> entry : definitions.entrySet()) { final Class taskClass = entry.getValue(); if (isAssignableFrom(extPoint, taskClass)) { final String elementName = entry.getKey(); myNestedElements.add(elementName); myNestedElementTypes.put(elementName, taskClass); } } }
|
processEntries
|
5,550 |
void (String extPoint) { for (Map.Entry<String, Collection<Class<?>>> entry : myRestrictedDefinitions.entrySet()) { for (Class<?> typeClass : entry.getValue()) { final String elementName = entry.getKey(); if (!myNestedElementTypes.containsKey(elementName) && isAssignableFrom(extPoint, typeClass)) { myNestedElements.add(elementName); myNestedElementTypes.put(elementName, typeClass); break; } } } }
|
processRestrictedTypeDefinitions
|
5,551 |
Iterator<String> () { final List<AntDomMacrodefAttribute> macrodefAttributes = myMacrodef.getMacroAttributes(); if (macrodefAttributes.isEmpty()) { return Collections.emptyIterator(); } final List<String> attribs = new ArrayList<>(macrodefAttributes.size()); for (AntDomMacrodefAttribute attribute : macrodefAttributes) { final String attribName = attribute.getName().getRawText(); if (attribName != null) { attribs.add(attribName); } } return attribs.iterator(); }
|
getAttributesIterator
|
5,552 |
boolean () { return myMacrodef.getMacroElements().stream() .map(AntDomMacrodefElement::isImplicit) .anyMatch(implicit -> implicit != null && Boolean.TRUE.equals(implicit.getValue())); }
|
isContainer
|
5,553 |
boolean () { return getContexts().stream().allMatch(AbstractIntrospector::isContainer); }
|
isContainer
|
5,554 |
Iterator<String> () { return getNestedElementsMap().keySet().iterator(); }
|
getNestedElementsIterator
|
5,555 |
Class (String elementName) { return getNestedElementsMap().get(elementName); }
|
getNestedElementType
|
5,556 |
List<AbstractIntrospector> () { if (myContexts != null) { return myContexts; } final List<AbstractIntrospector> parents = new ArrayList<>(); final AntDomMacroDef macroDef = myElement.getParentOfType(AntDomMacroDef.class, true); if (macroDef != null) { final AntDomSequentialTask body = macroDef.getMacroBody(); if (body != null) { body.accept(new AntDomRecursiveVisitor() { @Override public void visitAntDomCustomElement(AntDomCustomElement custom) { if (myElement.equals(custom.getDeclaringElement())) { final AntDomElement parent = custom.getParentOfType(AntDomElement.class, true); if (parent != null) { final Class type = parent.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY); if (type != null) { final AntIntrospector antIntrospector = AntIntrospector.getInstance(type); if (antIntrospector != null) { parents.add(new ClassIntrospectorAdapter(antIntrospector)); } } } } } }); } } return myContexts = parents; }
|
getContexts
|
5,557 |
void (AntDomCustomElement custom) { if (myElement.equals(custom.getDeclaringElement())) { final AntDomElement parent = custom.getParentOfType(AntDomElement.class, true); if (parent != null) { final Class type = parent.getChildDescription().getUserData(ELEMENT_IMPL_CLASS_KEY); if (type != null) { final AntIntrospector antIntrospector = AntIntrospector.getInstance(type); if (antIntrospector != null) { parents.add(new ClassIntrospectorAdapter(antIntrospector)); } } } } }
|
visitAntDomCustomElement
|
5,558 |
Iterator<String> () { final List<AntDomScriptdefAttribute> macrodefAttributes = myScriptDef.getScriptdefAttributes(); final List<String> attribs = new ArrayList<>(macrodefAttributes.size()); for (AntDomScriptdefAttribute attribute : macrodefAttributes) { final String nameAttrib = attribute.getName().getRawText(); if (nameAttrib != null) { attribs.add(nameAttrib); } } return attribs.iterator(); }
|
getAttributesIterator
|
5,559 |
boolean () { return false; }
|
isContainer
|
5,560 |
boolean () { return myEnum.hasMoreElements(); }
|
hasNext
|
5,561 |
T () { return myEnum.nextElement(); }
|
next
|
5,562 |
void () { throw new UnsupportedOperationException("remove is not supported"); }
|
remove
|
5,563 |
AntDomProject (GenericAttributeValue attribValue) { return attribValue.getParentOfType(AntDomProject.class, false); }
|
getEffectiveAntProject
|
5,564 |
List<GenericAttributeValue<String>> () { return Collections.singletonList(getName()); }
|
getPropertyDefiningAttributes
|
5,565 |
boolean () { return myShouldBeSkippedByAnnotator; }
|
shouldBeSkippedByAnnotator
|
5,566 |
void (boolean value) { myShouldBeSkippedByAnnotator = true; }
|
setShouldBeSkippedByAnnotator
|
5,567 |
DomElement (PsiElement resolve) { if (resolve instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)resolve).getTarget(); if(target instanceof DomTarget) { return ((DomTarget)target).getDomElement(); } return null; } return DomUtil.getDomElement(resolve); }
|
toDomElement
|
5,568 |
String (@Nullable TargetResolver.Result result, ConvertContext context) { return result != null? result.getRefsString() : null; }
|
toString
|
5,569 |
PsiElement (@NlsSafe String propertyName) { return PROPERTY_NAME.equals(propertyName)? getXmlElement() : null; }
|
getNavigationElement
|
5,570 |
PsiFileSystemItem (@Nullable @NonNls String s, ConvertContext context) { final GenericAttributeValue attribValue = context.getInvocationElement().getParentOfType(GenericAttributeValue.class, false); if (attribValue == null) { return null; } String path = attribValue.getStringValue(); if (path == null) { path = getAttributeDefaultValue(context, attribValue); } if (path == null) { return null; } File file = new File(path); if (!file.isAbsolute()) { final AntDomProject antProject = getEffectiveAntProject(attribValue); if (antProject == null) { return null; } file = new File(getPathResolveRoot(context, antProject), path); } VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(file.getAbsolutePath())); if (vFile == null) { return null; } final PsiManager psiManager = context.getPsiManager(); return vFile.isDirectory()? psiManager.findDirectory(vFile) : psiManager.findFile(vFile); }
|
fromString
|
5,571 |
AntDomProject (GenericAttributeValue attribValue) { AntDomProject project = attribValue.getParentOfType(AntDomProject.class, false); if (project != null) { project = project.getContextAntProject(); } return project; }
|
getEffectiveAntProject
|
5,572 |
String (@Nullable PsiFileSystemItem file, ConvertContext context) { final GenericAttributeValue attribValue = context.getInvocationElement().getParentOfType(GenericAttributeValue.class, false); if (attribValue == null) { return null; } return attribValue.getRawText(); }
|
toString
|
5,573 |
boolean (@NotNull XmlFile file, @Nullable Module module) { return super.isMyFile(file, module) && isAntFile(file); }
|
isMyFile
|
5,574 |
Icon (@Iconable.IconFlags int flags) { return AntIcons.AntBuildXml; }
|
getFileIcon
|
5,575 |
boolean (final XmlFile xmlFile) { final XmlDocument document = xmlFile.getDocument(); if (document != null) { final XmlTag tag = document.getRootTag(); final VirtualFile vFile = xmlFile.getOriginalFile().getVirtualFile(); if (tag != null && ROOT_TAG_NAME.equals(tag.getName()) && tag.getContext() instanceof XmlDocument) { if (tag.getAttributeValue("name") != null && tag.getAttributeValue("default") != null && vFile != null && ForcedAntFileAttribute.mayBeAntFile(vFile)) { return true; } } if (vFile != null && ForcedAntFileAttribute.isAntFile(vFile)) { return true; } } return false; }
|
isAntFile
|
5,576 |
void (AntDomAntCallParam antCallParam) { // deliberately skip ancall params, they will be processed as a special case }
|
visitAntDomAntCallParam
|
5,577 |
record (PsiElement element, Collection<String> variants, PropertiesProvider provider) {}
|
PropertyData
|
5,578 |
PropertyData (@NotNull AntDomProject project, @NotNull String propertyName, DomElement contextElement) { final PropertyResolver resolver = new PropertyResolver(propertyName, contextElement); resolver.execute(project, project.getDefaultTarget().getRawText()); if (resolver.getContextElement() instanceof PropertiesProvider provider) { // special case - when context element is a property provider itself resolver.propertyProviderFound(provider); } return resolver.getResult(); }
|
resolve
|
5,579 |
PropertyData () { final PsiElement element = myResult != null ? myResult.getNavigationElement(myPropertyName) : null; return new PropertyData(element, Collections.unmodifiableSet(myVariants), myResult); }
|
getResult
|
5,580 |
void (PropertiesProvider propertiesProvider) { boolean found = false; for (Iterator<String> it = propertiesProvider.getNamesIterator(); it.hasNext();) { final String providerProperty = it.next(); myVariants.add(providerProperty); if (myPropertyName.equals(providerProperty)) { found = true; } } if (found) { myResult = propertiesProvider; stop(); } }
|
propertyProviderFound
|
5,581 |
List<Converter> (@NotNull GenericDomValue domElement) { final String raw = domElement.getRawText(); if (raw != null) { if (raw.contains("${") || raw.contains(File.separator) || (File.separatorChar != '/' && raw.contains("/"))) { return Collections.singletonList(new AntPathConverter()); } } return Collections.emptyList(); } @Override public Converter getConverter(@NotNull GenericDomValue domElement) { final List<Converter> converterList = getConverters(domElement); return converterList.isEmpty()? null : converterList.get(0); } }
|
getConverters
|
5,582 |
Converter (@NotNull GenericDomValue domElement) { final List<Converter> converterList = getConverters(domElement); return converterList.isEmpty()? null : converterList.get(0); }
|
getConverter
|
5,583 |
List<File> (@Nullable AntDomPattern pattern, Set<AntFilesProvider> processed) { assert pattern != null; final File singleFile = getCanonicalFile(getFile().getStringValue()); if (singleFile == null || pattern.hasIncludePatterns()) { // if singleFile is specified, there are no implicit includes final File root = getCanonicalFile(getDir().getStringValue()); if (root != null) { final ArrayList<File> files = new ArrayList<>(); if (singleFile != null) { files.add(singleFile); } new FilesCollector().collectFiles(files, root, "", pattern); return files; } } if (singleFile != null) { return Collections.singletonList(singleFile); } return Collections.emptyList(); }
|
getFiles
|
5,584 |
void (List<? super File> container, File from, String relativePath, final AntDomPattern pattern) { if (myDirsProcessed > MAX_DIRS_TO_PROCESS) { return; } final File[] children = from.listFiles(); if (children != null && children.length > 0) { if (myDirCheckEnabled) { if (!pattern.couldBeIncluded(relativePath)) { return; } } else { myDirCheckEnabled = true; } myDirsProcessed++; for (File child : children) { final String childPath = makePath(relativePath, child.getName()); if (pattern.acceptPath(childPath)) { container.add(child); } collectFiles(container, child, childPath, pattern); } } }
|
collectFiles
|
5,585 |
String (final String parentPath, final String name) { if (parentPath.length() == 0) { return name; } return parentPath + "/" + name; }
|
makePath
|
5,586 |
void (@NotNull PsiElement element, @NotNull @NlsSafe String newName, @NotNull Map<PsiElement, String> allRenames) { final AntDomElement antElement = convertToAntDomElement(element); String propName = null; if (antElement instanceof AntDomProperty) { propName = ((AntDomProperty)antElement).getName().getStringValue(); } else if (antElement instanceof AntDomAntCallParam) { propName = ((AntDomAntCallParam)antElement).getName().getStringValue(); } if (propName != null) { final AntDomProject contextProject = antElement.getContextAntProject(); final List<PsiElement> additional = AntCallParamsFinder.resolve(contextProject, propName); for (PsiElement psiElement : additional) { allRenames.put(psiElement, newName); } if (antElement instanceof AntDomAntCallParam) { final @NotNull PropertyData result = PropertyResolver.resolve(contextProject, propName, null); if (result.element() != null) { allRenames.put(result.element(), newName); } } } }
|
prepareRenaming
|
5,587 |
boolean (@NotNull PsiElement element) { final AntDomElement antElement = convertToAntDomElement(element); if (antElement instanceof AntDomProperty || antElement instanceof AntDomAntCallParam) { return true; } return false; }
|
canProcessElement
|
5,588 |
AntDomElement (PsiElement element) { if (element instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)element).getTarget(); if (target instanceof DomTarget) { final DomElement domElement = ((DomTarget)target).getDomElement(); if (domElement instanceof AntDomElement) { return (AntDomElement)domElement; } } } return null; }
|
convertToAntDomElement
|
5,589 |
void (@NonNls String refsString) { myRefsString = refsString; }
|
setRefsString
|
5,590 |
Collection<String> () { return Collections.unmodifiableSet(myMap.keySet()); }
|
getTargetReferences
|
5,591 |
Result (@NotNull AntDomProject project, @Nullable AntDomTarget contextTarget, @NotNull String declaredTargetRef) { return resolve(project, contextTarget, Collections.singletonList(declaredTargetRef)); }
|
resolve
|
5,592 |
Result (AntDomProject project, AntDomTarget contextTarget, @NotNull Collection<String> declaredTargetRefs) { final TargetResolver resolver = new TargetResolver(declaredTargetRefs, contextTarget); resolver.execute(project, null); final Result result = resolver.getResult(); result.setVariants(resolver.getDiscoveredTargets()); return result; }
|
resolve
|
5,593 |
void (AntDomProject project, final TargetSink sink) { final TargetResolver resolver = new TargetResolver(Collections.emptyList(), null) { @Override protected void duplicateTargetFound(AntDomTarget existingTarget, AntDomTarget duplicatingTarget, String taregetEffectiveName) { sink.duplicateTargetDetected(existingTarget, duplicatingTarget, taregetEffectiveName); } @Override protected void stageCompleted(Stage completedStage, Stage startingStage) { if (Stage.RESOLVE_MAP_BUILDING_STAGE.equals(completedStage)) { stop(); } } }; resolver.execute(project, null); }
|
validateDuplicateTargets
|
5,594 |
void (AntDomTarget existingTarget, AntDomTarget duplicatingTarget, String taregetEffectiveName) { sink.duplicateTargetDetected(existingTarget, duplicatingTarget, taregetEffectiveName); }
|
duplicateTargetFound
|
5,595 |
void (Stage completedStage, Stage startingStage) { if (Stage.RESOLVE_MAP_BUILDING_STAGE.equals(completedStage)) { stop(); } }
|
stageCompleted
|
5,596 |
void (AntDomTarget target, String targetEffectiveName, Map<String, Pair<AntDomTarget, String>> dependenciesMap) { if (myContextTarget != null && myDeclaredTargetRefs.size() > 0 && target.equals(myContextTarget)) { for (Iterator<String> it = myDeclaredTargetRefs.iterator(); it.hasNext();) { final String declaredRef = it.next(); final Pair<AntDomTarget, String> result = dependenciesMap.get(declaredRef); if (result != null) { myResult.add(declaredRef, result); it.remove(); } } stop(); } }
|
targetDefined
|
5,597 |
void (Stage completedStage, Stage startingStage) { if (completedStage == Stage.RESOLVE_MAP_BUILDING_STAGE) { if (myDeclaredTargetRefs.size() > 0) { for (Iterator<String> it = myDeclaredTargetRefs.iterator(); it.hasNext();) { final String declaredRef = it.next(); final AntDomTarget result = getTargetByName(declaredRef); if (result != null) { myResult.add(declaredRef, Pair.create(result, declaredRef)); // treat declared name as effective name it.remove(); } } } stop(); } }
|
stageCompleted
|
5,598 |
Result () { return myResult; }
|
getResult
|
5,599 |
void (PropertiesProvider propertiesProvider) { }
|
propertyProviderFound
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.