Top Description Inners Fields Constructors Methods
com.sun.codemodel

public abstract Class JModuleDirective

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.codemodel.JRequiresDirective, com.sun.codemodel.JExportsDirective

Represents a Java module directive. For example "exports foo.bar;" or "requires foo.baz;".
Author
Tomas Kraus

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
JModuleDirective.Type

Module directive type.

Field Summary

Modifier and TypeField and Description
protected final String
name

Name argument of module directive.

Constructor Summary

AccessConstructor and Description
pack-priv
JModuleDirective(final String
name argument of module directive.
name
)

Creates an instance of Java module directive.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the argument is not null and is a object with the same type and equal name.
equals
(final Object
The object to compare this against.
other
)

Overrides java.lang.Object.equals.

Compares this module directive to the specified object.

public abstract JFormatter

Returns:

provided instance of Java code formatter.
generate
(final JFormatter
Java code formatter.
f
)

Print source code of this module directive.

public abstract JModuleDirective.Type

Returns:

type of this module directive. Will never be null.
getType
()

Gets the type of this module directive.

public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this module directive based on directive type and name.

public String

Returns:

name of this module directive.
name
()

Gets the name of this module directive.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
protected final String name

Name argument of module directive.

Constructor Detail

JModuleDirectiveback to summary
pack-priv JModuleDirective(final String name)

Creates an instance of Java module directive.

Parameters
name:String

name argument of module directive.

Exceptions
IllegalArgumentException:
if the name argument is null.

Method Detail

equalsback to summary
public boolean equals(final Object other)

Overrides java.lang.Object.equals.

Compares this module directive to the specified object.

Parameters
other:Object

The object to compare this against.

Returns:boolean

true if the argument is not null and is a object with the same type and equal name.

Annotations
@Override
generateback to summary
public abstract JFormatter generate(final JFormatter f)

Print source code of this module directive.

Parameters
f:JFormatter

Java code formatter.

Returns:JFormatter

provided instance of Java code formatter.

getTypeback to summary
public abstract JModuleDirective.Type getType()

Gets the type of this module directive.

Returns:JModuleDirective.Type

type of this module directive. Will never be null.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this module directive based on directive type and name. The hash code for a module directive is computed as

    97 * (type_ordinal_value + 1) + name.hashCode()
using int arithmetic.
Returns:int

a hash code value for this object.

Annotations
@Override
nameback to summary
public String name()

Gets the name of this module directive.

Returns:String

name of this module directive.

com.sun.codemodel back to summary

public final Enum JModuleDirective.Type

extends Enum<JModuleDirective.Type>
Class Inheritance

Module directive type. Child class implements getType() method which returns corresponding value.

Field Summary

Modifier and TypeField and Description
public static final JModuleDirective.Type
ExportsDirective

Directive starting with exports keyword.

public static final JModuleDirective.Type
RequiresDirective

Directive starting with requires keyword.

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static JModuleDirective.Type
public static JModuleDirective.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ExportsDirectiveback to summary
public static final JModuleDirective.Type ExportsDirective

Directive starting with exports keyword.

RequiresDirectiveback to summary
public static final JModuleDirective.Type RequiresDirective

Directive starting with requires keyword.

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static JModuleDirective.Type valueOf(String name)
valuesback to summary
public static JModuleDirective.Type[] values()