Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
23,900 | void () { myValuePattern = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getValuePattern(), new LanguageTextField.SimpleDocumentCreator() { @Override public void customizePsiFile(PsiFile psiFile) { psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE); } }); } | createUIComponents |
23,901 | void (PsiFile psiFile) { psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE); } | customizePsiFile |
23,902 | void (@NotNull JList list, @Nls String s, int index, boolean selected, boolean hasFocus) { final SimpleTextAttributes attributes = IDs.contains(s) ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.ERROR_ATTRIBUTES; append(s, attributes); final Language language = InjectedLanguage.findLanguageById(s); if (language != null) { final FileType fileType = language.getAssociatedFileType(); if (fileType != null) { setIcon(fileType.getIcon()); append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES); append("(" + fileType.getDescription() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES); } } } | customizeCellRenderer |
23,903 | void (ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { updateHighlighters(); } } | itemStateChanged |
23,904 | void (AncestorEvent event) { updateHighlighters(); } | ancestorAdded |
23,905 | String () { return (String)myLanguage.getSelectedItem(); } | getLanguage |
23,906 | void (@NlsSafe String id) { final DefaultComboBoxModel<String> model = (DefaultComboBoxModel)myLanguage.getModel(); if (model.getIndexOf(id) == -1 && id.length() > 0) { model.insertElementAt(id, 0); } myLanguage.setSelectedItem(id); updateHighlighters(); } | setLanguage |
23,907 | String () { return myPrefix.getText(); } | getPrefix |
23,908 | void (String s) { if (!myPrefix.getText().equals(s)) { myPrefix.setText(s); } } | setPrefix |
23,909 | String () { return mySuffix.getText(); } | getSuffix |
23,910 | void (String s) { if (!mySuffix.getText().equals(s)) { mySuffix.setText(s); } } | setSuffix |
23,911 | void () { setLanguage(myOrigInjection.getInjectedLanguageId()); setPrefix(myOrigInjection.getPrefix()); setSuffix(myOrigInjection.getSuffix()); } | resetImpl |
23,912 | void (BaseInjection i) { i.setInjectedLanguageId(getLanguage()); i.setPrefix(getPrefix()); i.setSuffix(getSuffix()); } | apply |
23,913 | JPanel () { return myRoot; } | getComponent |
23,914 | T () { apply(myEditCopy); return myEditCopy; } | getInjection |
23,915 | void (@NotNull T copy) { myEditCopy = copy; for (Field panel : myOtherPanels) { final InjectionPanel p = getField(panel); p.init(copy); } } | init |
23,916 | boolean () { apply(myEditCopy); for (Field panel : myOtherPanels) { final InjectionPanel p = getField(panel); p.isModified(); } return !myEditCopy.equals(myOrigInjection); } | isModified |
23,917 | void () { for (Field panel : myOtherPanels) { getField(panel).apply(); } // auto-generated name should go last apply(myOrigInjection); if (!myOtherPanels.isEmpty()) { myOrigInjection.generatePlaces(); myEditCopy.copyFrom(myOrigInjection); } } | apply |
23,918 | void () { if (!myOtherPanels.isEmpty()) { myEditCopy.copyFrom(myOrigInjection); } for (Field panel : myOtherPanels) { getField(panel).reset(); } UIUtil.invokeAndWaitIfNeeded(() -> resetImpl()); } | reset |
23,919 | void (Runnable updater) { myUpdaters.add(updater); for (Field panel : myOtherPanels) { final InjectionPanel field = getField(panel); field.addUpdater(updater); } } | addUpdater |
23,920 | InjectionPanel (Field field) { try { return (InjectionPanel)field.get(this); } catch (IllegalAccessException e) { throw new Error(e); } } | getField |
23,921 | void () { apply(myEditCopy); for (Runnable updater : myUpdaters) { updater.run(); } } | updateTree |
23,922 | EditorEx () { final EditorEx ex = super.createEditor(); ex.setVerticalScrollbarVisible(true); ex.setHorizontalScrollbarVisible(true); return ex; } | createEditor |
23,923 | boolean () { return false; } | isOneLineMode |
23,924 | void (BaseInjection other) { final String displayName = myNameTextField.getText(); if (StringUtil.isEmpty(displayName)) { throw new IllegalArgumentException("Display name should not be empty"); } other.setDisplayName(displayName); boolean enabled = true; final StringBuilder sb = new StringBuilder(); final ArrayList<InjectionPlace> places = new ArrayList<>(); for (String s : myTextArea.getText().split("\\s*\n\\s*")) { final boolean nextEnabled; if (s.startsWith("+")) { nextEnabled = true; s = s.substring(1).trim(); } else if (s.startsWith("-")) { nextEnabled = false; s = s.substring(1).trim(); } else { sb.append(s.trim()); continue; } if (sb.length() > 0) { final String text = sb.toString(); places.add(new InjectionPlace(myHelper.compileElementPattern(text), enabled)); sb.setLength(0); } sb.append(s); enabled = nextEnabled; } if (sb.length() > 0) { final String text = sb.toString(); places.add(new InjectionPlace(myHelper.compileElementPattern(text), enabled)); } for (InjectionPlace place : places) { ElementPattern<? extends PsiElement> pattern = place.getElementPattern(); if (pattern instanceof PatternCompilerImpl.LazyPresentablePattern) { try { ((PatternCompilerImpl.LazyPresentablePattern<?>)pattern).compile(); } catch (Throwable ex) { throw new IllegalArgumentException("Pattern failed to compile:", ex); } } } other.setInjectionPlaces(places.toArray(InjectionPlace.EMPTY_ARRAY)); } | apply |
23,925 | void () { final StringBuilder sb = new StringBuilder(); for (InjectionPlace place : myOrigInjection.getInjectionPlaces()) { sb.append(place.isEnabled()?"+ ":"- ").append(place.getText()).append("\n"); } myTextArea.setText(sb.toString()); myNameTextField.setText(myOrigInjection.getDisplayName()); } | resetImpl |
23,926 | JPanel () { return myRoot; } | getComponent |
23,927 | void () { myLanguagePanel = new LanguagePanel(myProject, myOrigInjection); myAdvancedPanel = new AdvancedPanel(myProject, myOrigInjection); } | createUIComponents |
23,928 | void () { myFixture.configureByText("foo.xml", "<foo xmlns=\"http://foo.bar\" \n" + " xxx=\"ba<caret>r\"/>"); assertNull(myFixture.getReferenceAtCaretPosition()); assertTrue(new InjectLanguageAction().isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile())); assertFalse(new UnInjectLanguageAction().isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile())); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); assertFalse(new InjectLanguageAction().isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile())); assertTrue(new UnInjectLanguageAction().isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile())); myFixture.configureByText("bar.xml", "<foo xmlns=\"<error descr=\"URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)\">http://foo.bar</error>\" \n" + " xxx=\"<error descr=\"Cannot resolve file 'bar'\">b<caret>ar</error>\"/>"); myFixture.testHighlighting(); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(myFixture.getReferenceAtCaretPosition()); } | testInjectReference |
23,929 | void () { myFixture.configureByText("foo.xml", "<foo xmlns=\"http://foo.bar\" \n" + " xxx=\"ba<caret>r\"/>"); assertNull(myFixture.getReferenceAtCaretPosition()); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); Configuration configuration = Configuration.getInstance(); Element element = configuration.getState(); configuration.loadState(element); PsiManager.getInstance(getProject()).dropPsiCaches(); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(myFixture.getReferenceAtCaretPosition()); } | testSurviveSerialization |
23,930 | void () { myFixture.configureByText("foo.xml", "<foo xmlns=\"http://foo.bar\" <bar>x<caret>xx</bar>/>"); assertNull(myFixture.getReferenceAtCaretPosition()); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); assertTrue(myFixture.getReferenceAtCaretPosition() instanceof FileReference); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(myFixture.getReferenceAtCaretPosition()); } | testInjectIntoTagValue |
23,931 | void () { myFixture.configureByText("Foo.java", """ class Foo { String bar() { return "ba<caret>r.xml"; } \s }"""); assertNull(getInjectedReferences()); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); PsiReference[] references = getInjectedReferences(); PsiReference reference = assertOneElement(references); assertTrue(reference instanceof FileReference); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(getInjectedReferences()); } | testInjectIntoJava |
23,932 | void () { myFixture.configureByText("Survive.java", """ class Survive { String bar() { return "ba<caret>r.xml"; } \s }"""); assertNull(getInjectedReferences()); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector()); PsiReference[] references = getInjectedReferences(); PsiReference reference = assertOneElement(references); assertTrue(reference instanceof FileReference); String textToReplace = "\"bar.xml\""; WriteCommandAction.runWriteCommandAction(getProject(), () -> { PsiDocumentManager manager = PsiDocumentManager.getInstance(getProject()); Document document = manager.getDocument(getFile()); int start = document.getText().indexOf(textToReplace); document.replaceString(start, start + textToReplace.length(), "null"); manager.commitDocument(document); }); assertNull(getInjectedReferences()); } | testInjectionDoesntSurviveLiteralReplacement |
23,933 | void () { myFixture.configureByText("Foo.java", """ class Foo { String bar() { String result = "{\\"a<caret>\\" : 1}"; return result; } \s }"""); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), Injectable.fromLanguage(Language.findLanguageByID("JSON"))); myFixture.checkResult(""" class Foo { String bar() { String result = "{\\"a\\" : 1}"; return result; } \s }"""); assertInjectedLangAtCaret("JSON"); undo(); assertInjectedLangAtCaret(null); } | testUndoLanguageInjection |
23,934 | void () { UIUtil.invokeAndWaitIfNeeded(() -> { final TestDialog oldTestDialog = TestDialogManager.setTestDialog(TestDialog.OK); try { UndoManager undoManager = UndoManager.getInstance(getProject()); TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(getEditor()); undoManager.undo(textEditor); } finally { TestDialogManager.setTestDialog(oldTestDialog); } }); } | undo |
23,935 | void () { myFixture.configureByText("Foo.java", """ class Foo { @org.intellij.lang.annotations.Language("file-reference") String bar() { return "<error descr="Cannot resolve file 'unknown.file'">unknown.file</error>"; } \s }"""); myFixture.testHighlighting(); } | testInjectByAnnotation |
23,936 | void () { myFixture.configureByText("Foo.java", """ class Foo { String bar() { String result = "{\\"a<caret>\\" : 1}"; return result; } \s }"""); PsiLanguageInjectionHost injectionHost = myFixture.findElementByText("\"{\\\"a\\\" : 1}\"", PsiLanguageInjectionHost.class); SmartPsiElementPointer<PsiLanguageInjectionHost> hostPtr = SmartPointerManager.createPointer(injectionHost); StoringFixPresenter storedFix = new StoringFixPresenter(); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), Injectable.fromLanguage(Language.findLanguageByID("JSON")), storedFix); myFixture.checkResult(""" class Foo { String bar() { String result = "{\\"a\\" : 1}"; return result; } \s }"""); assertInjectedLangAtCaret("JSON"); storedFix.process(hostPtr.getElement()); myFixture.checkResult(""" import org.intellij.lang.annotations.Language; class Foo { String bar() { @Language("JSON") String result = "{\\"a\\" : 1}"; return result; } \s }"""); assertInjectedLangAtCaret("JSON"); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertInjectedLangAtCaret(null); } | testConvertToAnnotationLanguageInjection |
23,937 | void () { myFixture.configureByText("Foo.java", """ class Foo { String bar() { String result = "ba<caret>r.xml"; return result; } \s }"""); PsiLanguageInjectionHost injectionHost = myFixture.findElementByText("\"bar.xml\"", PsiLanguageInjectionHost.class); SmartPsiElementPointer<PsiLanguageInjectionHost> hostPtr = SmartPointerManager.createPointer(injectionHost); StoringFixPresenter storedFix = new StoringFixPresenter(); InjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile(), new FileReferenceInjector(), storedFix); myFixture.checkResult(""" class Foo { String bar() { String result = "bar.xml"; return result; } \s }"""); assertTrue(assertOneElement(getInjectedReferences()) instanceof FileReference); storedFix.process((hostPtr.getElement())); myFixture.checkResult(""" import org.intellij.lang.annotations.Language; class Foo { String bar() { @Language("file-reference") String result = "bar.xml"; return result; } \s }"""); assertTrue(assertOneElement(getInjectedReferences()) instanceof FileReference); UnInjectLanguageAction.invokeImpl(getProject(), myFixture.getEditor(), myFixture.getFile()); assertNull(getInjectedReferences()); } | testConvertToAnnotationReferenceInjection |
23,938 | void () { myFixture.configureByText("Foo.java", """ class Foo { void bar() { @org.intellij.lang.annotations.Language("encoding-reference") String cset = true ? "<error descr="Unknown encoding: 'cp1252345'">cp1252345</error>" : "utf-8";// } }"""); myFixture.testHighlighting(); } | testTernary |
23,939 | void () { myFixture.configureByText("Foo.java", """ class Foo { void bar() { @org.intellij.lang.annotations.Language("encoding-reference") String cset = true ? <error descr="Unknown encoding: ''">""</error> : "utf-8";// } }"""); myFixture.testHighlighting(); } | testEmptyLiteral |
23,940 | PsiReference[] () { PsiElement element = myFixture.getFile().findElementAt(myFixture.getCaretOffset()); element = PsiTreeUtil.getParentOfType(element, PsiLanguageInjectionHost.class); assertNotNull(element); return InjectedReferencesContributor.getInjectedReferences(element); } | getInjectedReferences |
23,941 | String () { return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/completion/methodNameRef/"; } | getBasePath |
23,942 | void () { String input = """ import org.intellij.lang.annotations.Language; class Scratch { @Language("jvm-method-name") @interface MethodName {} public @interface ComponentProperties { // ... various other attributes ... @MethodName String waitForMethod() default ""; } public class MainComponent { @ComponentProperties(waitForMethod = "<error descr="Cannot resolve symbol 'waitForB'">waitForB<caret></error>") public BlueComponent blueComponent; private void waitForBlueComponent() { // ... } } \s interface BlueComponent {} }"""; myFixture.configureByText("MethodName.java", input); myFixture.enableInspections(new InjectedReferencesInspection()); myFixture.checkHighlighting(); myFixture.completeBasic(); String result = """ import org.intellij.lang.annotations.Language; class Scratch { @Language("jvm-method-name") @interface MethodName {} public @interface ComponentProperties { // ... various other attributes ... @MethodName String waitForMethod() default ""; } public class MainComponent { @ComponentProperties(waitForMethod = "waitForBlueComponent<caret>") public BlueComponent blueComponent; private void waitForBlueComponent() { // ... } } \s interface BlueComponent {} }"""; myFixture.checkResult(result); PsiElement element = myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset()); assertTrue(element instanceof PsiJavaToken); element = element.getParent(); assertTrue(element instanceof PsiLiteralExpression); PsiReference[] refs = element.getReferences(); assertEquals(1, refs.length); PsiElement target = refs[0].resolve(); assertTrue(target instanceof PsiMethod); assertEquals("waitForBlueComponent", ((PsiMethod)target).getName()); } | testMethodName |
23,943 | void () { // ... } | waitForBlueComponent |
23,944 | void () { // ... } | waitForBlueComponent |
23,945 | void () { highlightTest(""" import org.intellij.lang.annotations.Language; class X { void test() { String javaCode = "class X {<error descr="'}' expected">"</error>; foo(javaCode); } \s native void foo(@Language("JAVA") String str); }"""); } | testSimple |
23,946 | void () { highlightTest(""" import org.intellij.lang.annotations.Language; class X { void test() { String content = "void test() {"; content += "}}"; foo("class X {"+content+"<error descr="'class' or 'interface' expected">}</error>"); } native void foo(@Language("JAVA") String str); } | testConcatenation |
23,947 | void (String text) { Configuration.AdvancedConfiguration configuration = Configuration.getInstance().getAdvancedConfiguration(); Configuration.DfaOption oldOption = configuration.getDfaOption(); try { configuration.setDfaOption(Configuration.DfaOption.DFA); myFixture.configureByText("X.java", text); myFixture.testHighlighting(); } finally { configuration.setDfaOption(oldOption); } } | highlightTest |
23,948 | void () { highlightTest(""" import org.intellij.lang.annotations.Language; class X { @Language("JavaScript") String JS_CODE = "var x;"; @Language("XPath") String XPATH_CODE = (((<warning descr="Language mismatch: Expected 'XPath', got 'JavaScript'">JS_CODE</warning>))); } """); } | testParenthesesHighlighting |
23,949 | void () { quickFixTest(""" import org.intellij.lang.annotations.Language; class X { String JS_CODE = "var y;"; @Language("JavaScript") String OTHER_JS_CODE = JS_<caret>CODE; } """, """ import org.intellij.lang.annotations.Language; class X { @Language("JavaScript") String JS_CODE = "var y;"; @Language("JavaScript") String OTHER_JS_CODE = JS_<caret>CODE; } """, "Annotate field 'JS_CODE' as '@Language'"); } | testAnnotateFix |
23,950 | void () { highlightTest(""" import org.intellij.lang.annotations.Language; class X { public static final String[] EMPTY_ARRAY = {}; @Language("HTML") String[] getCode() { return EMPTY_ARRAY; } } """); } | testEmptyArrayConstant |
23,951 | void (String text) { myFixture.configureByText("X.java", text); myFixture.testHighlighting(); } | highlightTest |
23,952 | void (String before, String after, String hint) { myFixture.configureByText("X.java", before); IntentionAction action = myFixture.findSingleIntention(hint); myFixture.checkPreviewAndLaunchAction(action); myFixture.checkResult(after); } | quickFixTest |
23,953 | void () { highlightTest(""" import org.intellij.lang.annotations.Pattern; class X { @Pattern("[0-9]+") String str = <warning descr="Expression '123a' doesn't match pattern: [0-9]+">"123a"</warning>; @Anno(foo = <warning descr="Expression '123b' doesn't match pattern: [0-9]+">"123b"</warning>) int x; @interface Anno { @Pattern("[0-9]+") String foo(); } }"""); } | testPatternValidator |
23,954 | void () { quickFixTest(""" import org.intellij.lang.annotations.Pattern; class X { @Pattern("[0-9]+") String str = create<caret>Value(); public static String createValue() { return 123 + "a"; } } """, """ import org.intellij.lang.annotations.Pattern; import org.intellij.lang.annotations.Subst; class X { @Pattern("[0-9]+") String str = createValue(); @Subst("<caret>") public static String createValue() { return 123 + "a"; } } """, "Annotate method 'createValue()' as '@Subst'"); } | testAddAnnotationFix |
23,955 | String () { return 123 + "a"; } | createValue |
23,956 | String () { return 123 + "a"; } | createValue |
23,957 | void () { quickFixTest(""" import org.intellij.lang.annotations.Pattern; class X { @Pattern("[0-9]+") public static String createValue(int i) { return 123 + String.value<caret>Of(i); } } """, """ import org.intellij.lang.annotations.Pattern; class X { @Pattern("[0-9]+") public static String createValue(int i) { String s = String.valueOf(i); return 123 + s; } } """, "Introduce variable"); } | testAddLocalVariableFix |
23,958 | String (int i) { return 123 + String.value<caret>Of(i); } | createValue |
23,959 | String (int i) { String s = String.valueOf(i); return 123 + s; } | createValue |
23,960 | void (String text) { myFixture.configureByText("X.java", text); myFixture.testHighlighting(); } | highlightTest |
23,961 | void (String before, String after, String hint) { myFixture.configureByText("X.java", before); IntentionAction action = myFixture.findSingleIntention(hint); myFixture.checkPreviewAndLaunchAction(action); myFixture.checkResult(after); } | quickFixTest |
23,962 | boolean () { return true; } | isValid |
23,963 | ContextType () { return XPathSupport.TYPE; } | getContextType |
23,964 | XPathType (XPathExpression expr) { return XPathType.BOOLEAN; } | getExpectedType |
23,965 | XmlElement () { // needed because the static method ContextProvider.isValid() checks this to determine if the provider // is still valid - refactor this into an instance method ContextProvider.isValid()? return myDummyContext; } | getContextElement |
23,966 | NamespaceContext () { return null; } | getNamespaceContext |
23,967 | VariableContext () { return null; } | getVariableContext |
23,968 | Set<QName> (boolean forValidation) { return null; } | getAttributes |
23,969 | Set<QName> (boolean forValidation) { return null; } | getElements |
23,970 | void (@NotNull PsiFile file) { myProvider.attachTo(file); } | attachContext |
23,971 | String () { return myAttributeNameMatcher.getPattern(); } | getAttributeName |
23,972 | void (@NotNull String attributeName) { myAttributeNameMatcher = StringMatcher.create(attributeName); } | setAttributeName |
23,973 | void (@NotNull String attributeNamespace) { myAttributeNamespace = attributeNamespace; } | setAttributeNamespace |
23,974 | boolean (@NotNull XmlAttributeValue value) { final PsiElement element = value.getParent(); return element instanceof XmlAttribute && matches((XmlAttribute)element); } | isApplicable |
23,975 | void () { if (StringUtil.isEmpty(getDisplayName())) setDisplayName(getGeneratedName()); setInjectionPlaces(new InjectionPlace(getCompiler().createElementPattern(getPatternString(this), getDisplayName()), true)); } | generatePlaces |
23,976 | boolean (@NotNull XmlAttribute attr) { // mind IDEA-5206 final boolean b = myAttributeNameMatcher.matches(attr.getLocalName()) && (attr.getName().indexOf(':') == -1 || myAttributeNamespace.equals(attr.getNamespace())) && matches(attr.getParent()); return b && matchXPath(attr); } | matches |
23,977 | XmlAttributeInjection () { return new XmlAttributeInjection().copyFrom(this); } | copy |
23,978 | XmlAttributeInjection (@NotNull BaseInjection o) { super.copyFrom(o); if (o instanceof XmlAttributeInjection other) { setApplyToSubTags(other.isApplyToSubTags()); setAttributeName(other.getAttributeName()); setAttributeNamespace(other.getAttributeNamespace()); } return this; } | copyFrom |
23,979 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; final XmlAttributeInjection that = (XmlAttributeInjection)o; if (!myAttributeNameMatcher.getPattern().equals(that.myAttributeNameMatcher.getPattern())) return false; if (!myAttributeNamespace.equals(that.myAttributeNamespace)) return false; return true; } | equals |
23,980 | int () { int result = super.hashCode(); result = 31 * result + myAttributeNameMatcher.getPattern().hashCode(); result = 31 * result + myAttributeNamespace.hashCode(); return result; } | hashCode |
23,981 | String (final XmlAttributeInjection injection) { final String name = injection.getAttributeName(); final String namespace = injection.getAttributeNamespace(); final StringBuilder result = new StringBuilder("xmlAttribute()"); if (StringUtil.isNotEmpty(name)) appendStringPattern(result, ".withLocalName(", name, ")"); if (StringUtil.isNotEmpty(namespace)) appendStringPattern(result, ".withNamespace(", namespace, ")"); if (StringUtil.isNotEmpty(injection.getTagName()) || StringUtil.isNotEmpty(injection.getTagNamespace())) { result.append(".").append(injection.isApplyToSubTags() ? "inside" : "withParent").append("(") .append(XmlTagInjection.getPatternString(injection)).append(")"); } return result.toString(); } | getPatternString |
23,982 | boolean (@NotNull final XmlTag context) { return matches(context) && matchXPath(context); } | isApplicable |
23,983 | XmlTagInjection () { return new XmlTagInjection().copyFrom(this); } | copy |
23,984 | XmlTagInjection (@NotNull BaseInjection o) { super.copyFrom(o); return this; } | copyFrom |
23,985 | void () { if (StringUtil.isEmpty(getDisplayName())) setDisplayName(getGeneratedName()); setInjectionPlaces(new InjectionPlace(getCompiler().createElementPattern(getPatternString(this), getDisplayName()), true)); } | generatePlaces |
23,986 | String (final AbstractTagInjection injection) { final String name = injection.getTagName(); final String namespace = injection.getTagNamespace(); final StringBuilder result = new StringBuilder("xmlTag()"); if (StringUtil.isNotEmpty(name)) appendStringPattern(result, ".withLocalName(", name, ")"); if (StringUtil.isNotEmpty(namespace)) appendStringPattern(result, ".withNamespace(", namespace, ")"); return result.toString(); } | getPatternString |
23,987 | String () { return myTagName.getPattern(); } | getTagName |
23,988 | void (@NotNull @NlsSafe String tagName) { myTagName = StringMatcher.create(tagName); } | setTagName |
23,989 | boolean (final PsiElement element) { return super.acceptsPsiElement(element) && (!(element instanceof XmlElement) || matchXPath((XmlElement)element)); } | acceptsPsiElement |
23,990 | void (@NotNull @NonNls String tagNamespace) { myTagNamespace = new TreeSet<>(StringUtil.split(tagNamespace, "|")); } | setTagNamespace |
23,991 | String () { return myXPathCondition; } | getXPathCondition |
23,992 | void (@Nullable String condition) { myXPathCondition = StringUtil.notNullize(condition); myCompiledXPathCondition = null; } | setXPathCondition |
23,993 | Condition<XmlElement> () { if (StringUtil.isEmptyOrSpaces(myXPathCondition)) return Conditions.alwaysTrue(); try { XPathSupportProxy xPathSupport = XPathSupportProxy.getInstance(); if (xPathSupport != null) { XPath path = xPathSupport.createXPath(myXPathCondition); return context -> { try { return path.booleanValueOf(context); } catch (JaxenException e) { LOG.warn(e); myCompiledXPathCondition = Conditions.alwaysFalse(); return false; } }; } } catch (JaxenException e) { LOG.warn("Invalid XPath expression", e); } return Conditions.alwaysFalse(); } | compileXPath |
23,994 | boolean (@Nullable XmlTag tag) { if (tag == null) { return false; } if (!myTagName.matches(tag.getLocalName())) { return false; } if (!myTagNamespace.contains(tag.getNamespace())) { return false; } return true; } | matches |
23,995 | AbstractTagInjection (@NotNull BaseInjection o) { super.copyFrom(o); if (o instanceof AbstractTagInjection other) { myTagName = other.myTagName; myTagNamespace = other.myTagNamespace; setXPathCondition(other.getXPathCondition()); setApplyToSubTags(other.isApplyToSubTags()); } return this; } | copyFrom |
23,996 | void (Element e) { setXPathCondition(e.getChildText("xpath-condition")); myApplyToSubTags = e.getChild("apply-to-subtags") != null; } | readExternalImpl |
23,997 | void (Element e) { if (StringUtil.isNotEmpty(myXPathCondition)) { e.addContent(new Element("xpath-condition").setText(myXPathCondition)); } if (myApplyToSubTags) { e.addContent(new Element("apply-to-subtags")); } } | writeExternalImpl |
23,998 | boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; final AbstractTagInjection that = (AbstractTagInjection)o; if (!myTagName.equals(that.myTagName)) return false; if (!myTagNamespace.equals(that.myTagNamespace)) return false; if (!myXPathCondition.equals(that.myXPathCondition)) return false; if (myApplyToSubTags != that.myApplyToSubTags) return false; return true; } | equals |
23,999 | int () { int result = super.hashCode(); result = 31 * result + myTagName.hashCode(); result = 31 * result + myTagNamespace.hashCode(); result = 31 * result + myXPathCondition.hashCode(); result = 31 * result + (myApplyToSubTags ? 1 : 0); return result; } | hashCode |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.