Skip to content

Commit

Permalink
java doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Sep 21, 2023
1 parent 224ea43 commit b70dc28
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void executeTemplate( URL templateURL ) throws Throwable {
/**
* Execute a single template in its own context using a {@see URL} of the template to execution
*
* @param templateURL A URL location to execution
* @param template A template to execute
*
* @throws Throwable if the template cannot be executed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,14 @@ public class BaseBoxContext implements IBoxContext {
/**
* Creates a new execution context with a bounded execution template and parent context
*
* @param template The template that this execution context is bound to
* @param parent The parent context
* @param parent The parent context
*/
public BaseBoxContext( IBoxContext parent ) {
this.parent = parent;
}

/**
* Creates a new execution context with a bounded execution template
*
* @param templatePath The template that this execution context is bound to
* Creates a new execution context with no execution template
*/
public BaseBoxContext() {
this( null );
Expand All @@ -79,7 +76,7 @@ public BaseBoxContext() {
/**
* Push a template to the stack
*
* @param templatePath The template that this execution context is bound to
* @param template The template that this execution context is bound to
*
* @return IBoxContext
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class CatchBoxContext extends BaseBoxContext {
/**
* Creates a new execution context with a bounded execution template and parent context
*
* @param templatePath The template that this execution context is bound to
* @param parent The parent context
* @param exceptionKey The key to use for the exception
* @param exception The exception to store
*/
public CatchBoxContext( IBoxContext parent, Key exceptionKey, Throwable exception ) {
super( parent );
Expand All @@ -71,7 +72,9 @@ public CatchBoxContext( IBoxContext parent, Key exceptionKey, Throwable exceptio
* Meaning it needs to search scopes in order according to it's context.
* A nearby lookup is used for the closest context to the executing code
*
* @param key The key to search for
* @param key The key to search for
* @param defaultScope The default scope to use if the key is not found
* @param shallow true, do not delegate to parent or default scope if not found
*
* @return The value of the key if found
*
Expand Down Expand Up @@ -100,7 +103,8 @@ public ScopeSearchResult scopeFindNearby( Key key, IScope defaultScope, boolean
* Unlike scopeFindNearby(), this version only searches trancedent scopes like
* cgi or server which are never encapsulated like variables is inside a CFC.
*
* @param key The key to search for
* @param key The key to search for
* @param defaultScope The default scope to use if the key is not found
*
* @return The value of the key if found
*
Expand All @@ -127,6 +131,8 @@ public ScopeSearchResult scopeFind( Key key, IScope defaultScope ) {
* Get a scope from the context. If not found, the parent context is asked.
* Don't search for scopes which are nearby to an execution context
*
* @param name The name of the scope to get
*
* @return The requested scope
*/
public IScope getScope( Key name ) throws ScopeNotFoundException {
Expand All @@ -146,6 +152,9 @@ public IScope getScope( Key name ) throws ScopeNotFoundException {
* Get a scope from the context. If not found, the parent context is asked.
* Search all konwn scopes
*
* @param name The name of the scope to get
* @param shallow true, do not delegate to parent or default scope if not found
*
* @return The requested scope
*/
public IScope getScopeNearby( Key name, boolean shallow ) throws ScopeNotFoundException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public interface IBoxContext {
/**
* Push a template to the stack
*
* @param templatePath The template that this execution context is bound to
* @param template The template that this execution context is bound to
*
* @return IBoxContext
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public class ScriptingBoxContext extends BaseBoxContext {
/**
* Creates a new execution context with a bounded execution template and parent context
*
* @param template The template that this execution context is bound to
* @param parent The parent context
* @param parent The parent context
*/
public ScriptingBoxContext( IBoxContext parent ) {
super( parent );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static Object set( Object object, Key key, Object value ) {
*
* @param object The object to dereference
* @param value The value to assign
* @param key The key to dereference
* @param keys The keys to dereference
*
* @return The value that was assigned
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ public Optional<DynamicObject> safeLoad( IBoxContext context, String name, List<
* @param context The current context of execution
* @param name The fully qualified path/name of the class to load
* @param resolverPrefix The prefix of the resolver to use
* @param imports The list of imports to use when resolving the class
*
* @return The invokable representation of the class
*
Expand All @@ -505,8 +504,6 @@ public Optional<DynamicObject> safeLoad( IBoxContext context, String name, Strin
* @param imports The list of imports to use when resolving the class
*
* @return The invokable representation of the class
*
* @throws ClassNotFoundException If the class was not found in the resolver
*/
public Optional<DynamicObject> safeLoad( IBoxContext context, String name, String resolverPrefix,
List<ImportDefinition> imports ) {
Expand Down
36 changes: 18 additions & 18 deletions runtime/src/main/java/ortus/boxlang/runtime/testing/Phase1.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ public static synchronized Phase1 getInstance() {
return instance;
}

/**
/*
* <pre>
<cfscript>
// Static reference to System (java proxy?)
variables['system'] = create java:java.lang.System;
// call constructor to create instance
variables.greeting = new java:java.lang.String( 'Hello' );
// Conditional, requires operation support
if( variables.greeting == 'Hello' ) {
// De-referencing "out" and "println" and calling Java method via invoke dynamic
variables.system.out.println(
// Multi-line statement, expression requires concat operator and possible casting
// Unscoped lookup requires scope search
greeting & " world"
)
}
</cfscript>
* <cfscript>
* // Static reference to System (java proxy?)
* variables['system'] = create java:java.lang.System;
* // call constructor to create instance
* variables.greeting = new java:java.lang.String( 'Hello' );
*
*
* // Conditional, requires operation support
* if( variables.greeting == 'Hello' ) {
* // De-referencing "out" and "println" and calling Java method via invoke dynamic
* variables.system.out.println(
* // Multi-line statement, expression requires concat operator and possible casting
* // Unscoped lookup requires scope search
* greeting & " world"
* )
* }
* </cfscript>
* </pre>
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,29 @@ public static synchronized Phase1Switch getInstance() {
return instance;
}

/**
/*
* <pre>
<cfscript>
variables.foo = "bar";
variables.systemOut = (create java:java.lang.System).out;
switch( "12" ) {
case "brad":
variables.systemOut.println("case 1");
break;
case 42: {
variables.systemOut.println("case 2");
break;
}
case 5+7:
variables.systemOut.println("case 3");
case variables.foo:
variables.systemOut.println("case 4");
break;
default:
variables.systemOut.println("default case");
}
</cfscript>
* <cfscript>
* variables.foo = "bar";
* variables.systemOut = (create java:java.lang.System).out;
*
* switch( "12" ) {
* case "brad":
* variables.systemOut.println("case 1");
* break;
* case 42: {
* variables.systemOut.println("case 2");
* break;
* }
* case 5+7:
* variables.systemOut.println("case 3");
* case variables.foo:
* variables.systemOut.println("case 4");
* break;
* default:
* variables.systemOut.println("default case");
* }
* </cfscript>
* </pre>
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@ public static synchronized Phase1TryCatch getInstance() {
return instance;
}

/**
/*
* <pre>
<cfscript>
system = create java:java.lang.System;
try {
1/0
} catch (any e) {
variables.system.out.println(e.message);
} finally {
variables.system.out.println("Finally");
}
try {
throw new java:ortus.boxlang.runtime.types.exceptions.BoxLangException( "My Message", "My detail", "com.foo.type" );
} catch ("com.foo.type" e) {
variables.system.out.println(e.message);
} catch (java.lang.RuntimeException e) {
variables.system.out.println(e.message);
}
</cfscript>
* <cfscript>
* system = create java:java.lang.System;
*
* try {
* 1/0
* } catch (any e) {
* variables.system.out.println(e.message);
* } finally {
* variables.system.out.println("Finally");
* }
*
* try {
* throw new java:ortus.boxlang.runtime.types.exceptions.BoxLangException( "My Message", "My detail", "com.foo.type" );
* } catch ("com.foo.type" e) {
* variables.system.out.println(e.message);
* } catch (java.lang.RuntimeException e) {
* variables.system.out.println(e.message);
* }
* </cfscript>
* </pre>
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ public Map<Key, Object> getMetadata() {
super( declaringContext );
}

/**
/*
* <pre>
( required string name='Brad' ) => {
var greeting = "Hello " & name;
out.println( "Inside Closure, outside lookup finds: " & outside )
return greeting;
}
* ( required string name='Brad' ) => {
* var greeting = "Hello " & name;
*
* out.println( "Inside Closure, outside lookup finds: " & outside )
*
* return greeting;
* }
* </pre>
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,26 @@ public static synchronized Phase2Closure getInstance() {
return instance;
}

/**
/*
* <pre>
<cfscript>
variables.outside = "Outside scope value";
variables.greet = ( required string name='Brad' ) => {
var greeting = "Hello " & name;
out.println( "Inside Closure, outside lookup finds: " & outside )
return greeting;
}
variables.out = (create java.lang.System).out;
// Positional args
variables.out.println( greet( 'John' ) );
// named args
variables.out.println( greet( name='John' ) );
</cfscript>
* <cfscript>
* variables.outside = "Outside scope value";
* variables.greet = ( required string name='Brad' ) => {
* var greeting = "Hello " & name;
*
* out.println( "Inside Closure, outside lookup finds: " & outside )
*
* return greeting;
* }
*
* variables.out = (create java.lang.System).out;
*
* // Positional args
* variables.out.println( greet( 'John' ) );
*
* // named args
* variables.out.println( greet( name='John' ) );
* </cfscript>
* </pre>
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public Map<Key, Object> getMetadata() {
return instance;
}

/**
/*
* <pre>
( required string name='Brad' ) -> {
var greeting = "Hello " & name;
return greeting;
}
* ( required string name='Brad' ) -> {
* var greeting = "Hello " & name;
* return greeting;
* }
* </pre>
*/
@Override
Expand Down
Loading

0 comments on commit b70dc28

Please sign in to comment.