Questions tagged [extending]

302 questions
10
votes
1 answer

Inserting code with XJC+xsd+jxb using the options " -Xinject-code -extension "

Im' trying to use the extension "-Xinject-code" of xjc to add some code to my generated classes. For the following simple xsd schema...
Pierre
  • 34,472
  • 31
  • 113
  • 192
9
votes
4 answers

Erlang: simple pubsub for processes — is my approach okay?

Disclaimer: I'm pretty new to Erlang and OTP. I want a simple pubsub in Erlang/OTP, where processes could subscribe at some "hub" and receive a copy of messages that were sent to that hub. I know about gen_event, but it processes events in one…
drdaeman
  • 11,159
  • 7
  • 59
  • 104
9
votes
3 answers

Java -- private constructor vs final and more

Suppose there is a class with all of its constructors declared as private. Eg.: public class This { private This () { } public someMethod( ){ // something here } // some more-- no other constructors } From what I know, making…
Roam
  • 4,831
  • 9
  • 43
  • 72
9
votes
3 answers

Array change listener

Possible Duplicate: Javascript - How to extend Array.prototype.push()? How can I be notified (run a pre-defined function) of any change to a registered array (or at least any addition or removal of elements)? I tried using prototype. I don't…
Adrian Bartholomew
  • 2,506
  • 6
  • 29
  • 37
8
votes
1 answer

Use JQuery AJAX Prefilter to Inspect Response Data And Conditionally Forward to 'Error' Event Handler

I may be way off course, but I was wondering if it's possible to use the JQuery prefilter functionality and analyze the response data in an Ajax Success and conditionally forward to the error event handler in my ajax calls based on the existence of…
icats
  • 959
  • 3
  • 13
  • 24
8
votes
1 answer

Javascript prototype extend base-class unable to access base-class properties/methods from prototype class

I have created a javascript class TkpSlider being inspired from this w3schools page. (JSFiddle) var TkpSlider = function (args) { args= args|| {}; }; var mainSwiper = new TkpSlider(); I have extended this to add some swipe ability being…
Ardeus
  • 1,921
  • 3
  • 17
  • 26
8
votes
2 answers

Extending an imported enum in another file and using it

I'm trying to extend an imported enum in a different file, and using that extended enum in another different file. The general case base.enum.ts export enum MyEnum { a = "Foo" } extended.enum.ts import { MyEnum } from './base.enum'; declare…
AnonAppDev
  • 83
  • 1
  • 4
8
votes
1 answer

How to create custom keywords C#

I'm writing a library for personal use that greatly expands C# features, and I was wondering on something quite interesting... Is it possible to create you own keywords? For example, if, foreach, for etc. The reason I want to do this can be found at…
TechnicalTophat
  • 1,655
  • 1
  • 15
  • 37
8
votes
4 answers

Overriding Doctrine_Record (sfDoctrineRecord) instance methods in Doctrine PHP Symfony

My background is in Propel, so I was hoping it would be a simple thing to override a magical getter in a Doctrine_Record (sfDoctrineRecord), but I'm getting either a Segfault or the override method is simply ignored in favor of the one in the…
notbrain
  • 3,366
  • 2
  • 32
  • 42
7
votes
2 answers

Adding a custom method to puppeteer.Page object

I would like to add custom methods to the puppeteer.Page object, so I could invoke them like so: let page = await browser.newPage(); page.myNewCustomMethod(); Here is one out of many custom methods I have created. It finds first available element…
RA.
  • 969
  • 13
  • 36
7
votes
3 answers

Extending functionality of Grails Plugin

I would like to know, if it is possible and if there is a generic way to extend the functionality of a grails plugin. I recently installed the commentable plugin, but need to do some modifications to it. Since the code is not stored together with…
Nicolas
  • 81
  • 3
7
votes
1 answer

Ecto Changeset add functionality for warnings

I created a fork of ecto repository to extend Ecto.Changeset module with the ability to add warnings to the changeset. I wanted to have an add_warnings/4 function which adds a warning to the changeset as a simple list of warnings with this…
7
votes
5 answers

JavaScript: Extending Element prototype

I have seen a lot of discussion regarding extending Element. As far as I can tell, these are the main issues: It may conflict with other libraries, It adds undocumented features to DOM routines, It doesn’t work with legacy IE, and It may conflict…
Manngo
  • 14,066
  • 10
  • 88
  • 110
6
votes
2 answers

Extend xUnit.NET to use custom code when processing a class and locating test methods

I'm a big fan of the xUnit.NET framework; I find it light, simple, clean, and extensible. Now let's say that I have a class like so: public class AdditionSpecification { static int result; public void Because() { result = 2 + 2; } …
David Alpert
  • 3,161
  • 1
  • 23
  • 19
6
votes
2 answers

How do you extend a django pluggable app?

Let's say I am using django-tagging application and I decide I want to add a form class to the existing tagging forms. I do not want to patch the form into the existing forms.py since it will be blown out when updated. How do I extend forms.py to…
chris
  • 825
  • 2
  • 9
  • 22
1
2
3
20 21