class

JSF: Backing Beans with nested objects?

JSF 1.1, using a backing bean with a nested objects inside I can read all properties of the nested object. For example assuming a backing bean named "foo" with a nested object "bar" can I set/write via h:form all the properties of foo.bar? I mean something like this: f:view h:form h:inputText value...

Load functions dynamically into class from external file.

Is it possible in php to load a function, say from a external file to include in a class. I'm trying to create a loader for helper functions so that I could call: $registry->helper->load('external_helper_function_file'); after that it should be able call the function in file like this: $registry->helper->function(); Thanks for any ...

Best way to convert from "Simple Class Name" to "Full Class Name" to Object in Java

So lets say I have an object that it stored in a Database: com.test.dummy.Cat The cat has an integer id. Outside of my "world" the reference to the object is a String of the form: Cat-433 Where 433 is the Cats assigned Database ID. When I get the String passed to me, I need to be able to find it in the Database. So I do this: St...

JNI signatures for nested classes?

Hi all, I'm trying to use JNI on WindowsXP, java version: java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing) When trying to get jclass for a nested class jclass c = env->FindClass ("A$B"); assert (c); the second line asserts, The same thing wo...

Return a nested class type in Java

I have a base class that has an abstract getType() method. I want subclasses to be able to implement this method and provide the actual class to use. In code, something like the following: public abstract class A { public static interface Tile; protected abstract Class<Tile> getTileClass(); } public class B extends A { p...

In Python, how do I reference a class generically in a static way, like PHP's "self" keyword?

PHP classes can use the keyword "self" in a static context, like this: <?php class Test { public static $myvar = 'a'; public static function t() { echo self::$myvar; // Generically reference the current class. echo Test::$myvar; // Same thing, but not generic. } } ?> Obviously I can't use "self" in this way in Python b...

Java: Using a foreign class which conforms to my interface

Hello! Can I take a foreign class in Java which conforms to one of my custom interfaces and "cast" it to that interface? Example: public class YouCanNotChangeMe_IAmNotYours{ public void doSomethingSpecial(); } public interface MyInterface{ void doSomethingSpecial(); } Can I use that foreign class in places where my interfac...

Protected class structure in Java?

Hi, I was wondering if there's a language feature in Java in which methods of a superclass would be invisible for members of a subclass: public class Subclass extends protected Superclass or something. I'll give an example. Here is your superclass. public class A{ public String getA(){...} public String getB(){...} publ...

Accessing static class variables in C++?

Duplicate: C++: undefined reference to static class member If I have a class/struct like this // header file class Foo { public: static int bar; int baz; int adder(); }; // implementation int Foo::adder() { return baz + bar; } This doesn't work. I get an "undefined reference to `Foo::bar'" error. How do I access stati...

What is the exact definition of instance variable?

For me instance variables are simple data types like int or double. Everything that is created automatically when the object is created. If an object creates additional objects - like everything that is it done with the NEW keyword - these are not instance variables. Am I right or wrong? ...

Using a class like a public variable in asp.net

I'm getting an error in .net when trying to declare a Public class on my code behind page. Partial Class _Default Inherits System.Web.UI.Page Public someVariable as integer Public someClass as className Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load [...] The error I'm ge...

Create new instance or just set internal variables

I've written a helper class that takes a string in the constructor and provides a lot of Get properties to return various aspects of the string. Currently the only way to set the line is through the constructor and once it is set it cannot be changed. Since this class only has one internal variable (the string) I was wondering if I shoul...

Java Generics Wildcarding With Multiple Classes

I want to have a Class object, but I want to force whatever class it represents to extend class A and implement interface B. I can do: Class<? extends ClassA> Or: Class<? extends InterfaceB> but I can't do both. Is there a way to do this? ...

LINQ To SQL Class diagram in Visual Studio

Is there a way to copy the class diagram generated by the LINQ To SQL ORM in VS2008 without using print screen (yes, I know it's pathetic)? For example, when I create database projects in Visual Studio I can copy the database diagrams and save them later in Paint.NET in any image format. Any idea or suggestion will be greatly appreciate...

How can I get the class object, when I only know the classname at runtime in Objective-C

Hi there, I need to get the class object out of a string, containing the name of the class at runtime. I found a function called objc_getClass, but I'm not sure if it's really what I search. Can I implement it like this? NSString *name = @"AnyClass"; Class *myClass = objc_getClass([name UTF8String]); ...

How to view code for classes in the .NET library?

I would like to look at the code for some of the classes in the .NET library. I find functions by using intellisense and just reading the tooltips that come up when I select different items. One example is the Contains method that you can use on arrays to search for a given string. I just happened to stumble upon that while working on...

Separating jquery and creating classes / namespaces? (OOP)

Hi, I recently came across DUI (diggs user interface) which implements jquery and gives you the ability to create classes, with jquery etc. I can't seem to find any reviews.. i saw one comment to say it wasn't up to much. I was wondering what everyone else is using with regards to separation of concerns with jquery Do you use some ki...

ASP.NET - How do you reference a class that is not in app_code

I have created a MasterPage called MyMasterPage. public partial class MyMasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { } } I have also created a class called Class1 in app_code: public class Class1 { public Class1() { MyMasterPage m; } } In Class1 I woul...

In which order should classes be declared in C++?

Say I got this C++ code: class class1{ class2 *x; } class class2{ class1 *x; } The compiler would give an error in line 2 because it couldn't find class2, and the same if i switched the order of the classes. How do I solve this? ...

JarScan, Scan all jar files in all subfolders for specific class.

We are seeing an older version of a class being used although we had the latest one deploy, to scan all jar files in all subfolders of appserver we need to write a small shell scripts that prints out jars in which this specific class is found. ...