|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.objects.natives.NATNil
edu.vub.at.objects.natives.NATByRef
edu.vub.at.objects.natives.NATCallframe
edu.vub.at.objects.natives.NATObject
edu.vub.at.objects.symbiosis.JavaPackage
A JavaPackage represents (part of) a Java package name and serves the same purpose as AmbientTalk Namespace objects, but for loading Java classes rather than AT objects. The behaviour of a JavaPackage object relies on Java naming conventions for automatic loading of classes. If some Java code does not follow the naming conventions, then explicit loading of packages or classes must be done via a JavaPackage's provided base-level methods. Selecting a field f from a JavaPackage encapsulating the path p has the following semantics: - if f starts with an uppercase symbol, the field access is interpreted as a class reference: The JavaPackage tries to load the class p.f. If the class does not exist, an XSelectorNotFound exception is thrown. - if f starts with a lowercase symbol, the field access is interpreted as a subpackage reference: The JavaPackage creates a new field referring to a JavaPackage whose path equals 'p.f.' JavaPackage instances are isolates, hence, they are pass-by-copy.
Field Summary | |
private static AGSymbol |
_CLS_NAME_
|
private static AGSymbol |
_PKG_NAME_
|
private static java.lang.String |
_PKG_SEP_
|
private static PrimitiveMethod |
_PRIM_CLS_
def class(name) { nil } |
private static PrimitiveMethod |
_PRIM_PKG_
def package(name) { nil } |
private java.lang.String |
path_
|
Fields inherited from class edu.vub.at.objects.natives.NATObject |
_EQL_NAME_, _INI_NAME_, _IS_A_, _NEW_NAME_, _NO_STRIPES_, _SHARES_A_, _SUPER_NAME_, stripes_ |
Fields inherited from class edu.vub.at.objects.natives.NATCallframe |
customFields_, lexicalParent_, stateVector_, variableMap_ |
Fields inherited from class edu.vub.at.objects.natives.NATNil |
_INSTANCE_ |
Constructor Summary | |
private |
JavaPackage(FieldMap map,
java.util.Vector state,
java.util.LinkedList customFields,
MethodDictionary methodDict,
ATObject dynamicParent,
ATObject lexicalParent,
byte flags,
ATStripe[] stripes,
java.lang.String path)
Private constructor used only for cloning |
|
JavaPackage(java.lang.String path)
A JavaPackage object encapsulates a package path. |
Method Summary | |
ATObject |
base_class(ATSymbol selector)
Allows the AT programmer to explicitly load a class. |
ATObject |
base_package(ATSymbol selector)
Allows the AT programmer to explicitly load a package. |
protected NATObject |
createClone(FieldMap map,
java.util.Vector state,
java.util.LinkedList customFields,
MethodDictionary methodDict,
ATObject dynamicParent,
ATObject lexicalParent,
byte flags,
ATStripe[] stripes)
|
ATObject |
meta_doesNotUnderstand(ATSymbol selector)
For a JavaPackage object, doesNotUnderstand triggers the querying of the Java classpath to load classes corresponding to the missing selector. |
NATText |
meta_print()
Prints out the object in a human-readable way. |
Methods inherited from class edu.vub.at.objects.natives.NATCallframe |
getLocalCustomField, getLocalField, hasLocalCustomField, hasLocalField, hasLocalNativeField, meta_addField, meta_assignVariable, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_listFields, setLocalField |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface edu.vub.at.objects.ATObject |
base__opeql__opeql_, base_init, base_new, meta_addField, meta_assignVariable, meta_eval, meta_getDynamicParent, meta_getLexicalParent, meta_grabField, meta_listFields, meta_quote, meta_receive, meta_send |
Methods inherited from interface edu.vub.at.objects.coercion.ATConversions |
asJavaClassUnderSymbiosis, asJavaObjectUnderSymbiosis, asNativeBoolean, asNativeException, asNativeFarReference, asNativeFraction, asNativeNumber, asNativeNumeric, asNativeTable, asNativeText, base_asFarReference, base_asVariableAssignment, base_isFarReference, base_isMessageCreation, base_isVariableAssignment, isJavaObjectUnderSymbiosis, isNativeBoolean, isNativeField, isNativeText |
Field Detail |
private static final java.lang.String _PKG_SEP_
private static final AGSymbol _CLS_NAME_
private static final AGSymbol _PKG_NAME_
private static final PrimitiveMethod _PRIM_CLS_
private static final PrimitiveMethod _PRIM_PKG_
private final java.lang.String path_
Constructor Detail |
public JavaPackage(java.lang.String path)
path
- the pathname of this JavaPackage, e.g. 'java.' or 'java.lang.'private JavaPackage(FieldMap map, java.util.Vector state, java.util.LinkedList customFields, MethodDictionary methodDict, ATObject dynamicParent, ATObject lexicalParent, byte flags, ATStripe[] stripes, java.lang.String path) throws InterpreterException
Method Detail |
public ATObject meta_doesNotUnderstand(ATSymbol selector) throws InterpreterException
meta_doesNotUnderstand
in interface ATObject
meta_doesNotUnderstand
in class NATCallframe
InterpreterException
public NATText meta_print() throws InterpreterException
ATObject
meta_print
in interface ATObject
meta_print
in class NATObject
InterpreterException
protected NATObject createClone(FieldMap map, java.util.Vector state, java.util.LinkedList customFields, MethodDictionary methodDict, ATObject dynamicParent, ATObject lexicalParent, byte flags, ATStripe[] stripes) throws InterpreterException
createClone
in class NATObject
InterpreterException
public ATObject base_class(ATSymbol selector) throws InterpreterException
InterpreterException
public ATObject base_package(ATSymbol selector) throws InterpreterException
InterpreterException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |