Java Doc for Name.java in  » Scripting » beanshell » bsh » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » beanshell » bsh 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   bsh.Name

Name
class Name implements java.io.Serializable(Code)
What's in a name? I'll tell you... Name() is a somewhat ambiguous thing in the grammar and so is this.

This class is a name resolver. It holds a possibly ambiguous dot separated name and reference to a namespace in which it allegedly lives. It provides methods that attempt to resolve the name to various types of entities: e.g. an Object, a Class, a declared scripted BeanShell method.

Name objects are created by the factory method NameSpace getNameResolver(), which caches them subject to a class namespace change. This means that we can cache information about various types of resolution here. Currently very little if any information is cached. However with a future "optimize" setting that defeats certain dynamic behavior we might be able to cache quite a bit.



Field Summary
 ClassasClass
    
 ClassclassOfStaticMethod
    
public  NameSpacenamespace
    
 Stringvalue
    

Constructor Summary
 Name(NameSpace namespace, String s)
     This constructor should *not* be used in general.

Method Summary
static  intcountParts(String value)
    
static  NameSpacegetClassNameSpace(NameSpace thisNameSpace)
    
public  ObjectinvokeMethod(Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo)
     Invoke the method identified by this name. Performs caching of method resolution using SignatureKey.

Name contains a wholely unqualfied messy name; resolve it to ( object | static prefix ) + method name and invoke.

The interpreter is necessary to support 'this.interpreter' references in the called code.

public static  booleanisCompound(String value)
    
static  Stringprefix(String value)
    
static  Stringprefix(String value, int parts)
    
 ObjectresolveThisFieldReference(CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible)
     Resolve a variable relative to a This reference. This is the general variable resolution method, accomodating special fields from the This context.
static  Stringsuffix(String name)
    
public static  Stringsuffix(String value, int parts)
    
public synchronized  ClasstoClass()
     Check the cache, else use toObject() to try to resolve to a class identifier.
public synchronized  LHStoLHS(CallStack callstack, Interpreter interpreter)
    
public  ObjecttoObject(CallStack callstack, Interpreter interpreter)
     Resolve possibly complex name to an object value.
public synchronized  ObjecttoObject(CallStack callstack, Interpreter interpreter, boolean forceClass)
    
public  StringtoString()
    

Field Detail
asClass
Class asClass(Code)
The result is a class



classOfStaticMethod
Class classOfStaticMethod(Code)
The result is a static method call on the following class



namespace
public NameSpace namespace(Code)



value
String value(Code)




Constructor Detail
Name
Name(NameSpace namespace, String s)(Code)
This constructor should *not* be used in general. Use NameSpace getNameResolver() which supports caching.
See Also:   NameSpace
See Also:    getNameResolver().




Method Detail
countParts
static int countParts(String value)(Code)



getClassNameSpace
static NameSpace getClassNameSpace(NameSpace thisNameSpace)(Code)
the enclosing class body namespace or null if not in a class.



invokeMethod
public Object invokeMethod(Interpreter interpreter, Object[] args, CallStack callstack, SimpleNode callerInfo) throws UtilEvalError, EvalError, ReflectError, InvocationTargetException(Code)
Invoke the method identified by this name. Performs caching of method resolution using SignatureKey.

Name contains a wholely unqualfied messy name; resolve it to ( object | static prefix ) + method name and invoke.

The interpreter is necessary to support 'this.interpreter' references in the called code. (e.g. debug());

 Some cases:
 // dynamic
 local();
 myVariable.foo();
 myVariable.bar.blah.foo();
 // static
 java.lang.Integer.getInteger("foo");
 



isCompound
public static boolean isCompound(String value)(Code)



prefix
static String prefix(String value)(Code)



prefix
static String prefix(String value, int parts)(Code)



resolveThisFieldReference
Object resolveThisFieldReference(CallStack callstack, NameSpace thisNameSpace, Interpreter interpreter, String varName, boolean specialFieldsVisible) throws UtilEvalError(Code)
Resolve a variable relative to a This reference. This is the general variable resolution method, accomodating special fields from the This context. Together the namespace and interpreter comprise the This context. The callstack, if available allows for the this.caller construct. Optionally interpret special "magic" field names: e.g. interpreter.


Parameters:
  callstack - may be null, but this is only legitimate in specialcases where we are sure resolution will not involve this.caller.
Parameters:
  namespace - the namespace of the this reference (should be thesame as the top of the stack?




suffix
static String suffix(String name)(Code)



suffix
public static String suffix(String value, int parts)(Code)



toClass
public synchronized Class toClass() throws ClassNotFoundException, UtilEvalError(Code)
Check the cache, else use toObject() to try to resolve to a class identifier.
throws:
  ClassNotFoundException - on class not found.
throws:
  ClassPathException - (type of EvalError) on special case of ambiguous unqualified name after super import.



toLHS
public synchronized LHS toLHS(CallStack callstack, Interpreter interpreter) throws UtilEvalError(Code)



toObject
public Object toObject(CallStack callstack, Interpreter interpreter) throws UtilEvalError(Code)
Resolve possibly complex name to an object value. Throws EvalError on various failures. A null object value is indicated by a Primitive.NULL. A return type of Primitive.VOID comes from attempting to access an undefined variable. Some cases: myVariable myVariable.foo myVariable.foo.bar java.awt.GridBagConstraints.BOTH my.package.stuff.MyClass.someField.someField... Interpreter reference is necessary to allow resolution of "this.interpreter" magic field. CallStack reference is necessary to allow resolution of "this.caller" magic field. "this.callstack" magic field.



toObject
public synchronized Object toObject(CallStack callstack, Interpreter interpreter, boolean forceClass) throws UtilEvalError(Code)

See Also:    toObject()
Parameters:
  forceClass - if true then resolution will only produce a class.This is necessary to disambiguate in cases where the grammar knowsthat we want a class; where in general the var path may be taken.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.