Top Description Fields Constructors Methods
org.python.indexer.ast

public Class NAlias

extends NNode
Class Inheritance
Imports
org.python.indexer.Scope, org.python.indexer.types.NType, .NUnknownType, java.util.List

A name alias. Used for the components of import and import-from statements.

Field Summary

Modifier and TypeField and Description
public NName
aname

The alias name, if an "as" clause was specified.

public String
name

The un-parsed qname or simple name corresponding to qname.

public NQname
qname

Represents one of three possibilities:

  1. import stmt: qname of one of the imported modules
  2. import-from stmt: qname of the referenced module
  3. import-from stmt: simple name imported from referenced module
pack-priv static final long
Inherited from org.python.indexer.ast.NNode:
parent

Constructor Summary

AccessConstructor and Description
public
NAlias(String name, NQname qname, NName aname)

public
NAlias(String name, NQname qname, NName aname, int start, int end)

Method Summary

Modifier and TypeMethod and Description
public String
getBoundName()

Returns the alias, if non-null, else the simple name.

public NType
resolve(Scope s)

Overrides org.python.indexer.ast.NNode.resolve.

Resolves and returns the referenced org.python.indexer.types.NModuleType in an import or or import-from statement.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
visit(NNodeVisitor
the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.
v
)

Implements abstract org.python.indexer.ast.NNode.visit.

Visits this node and optionally its children.

Inherited from org.python.indexer.ast.NNode:
addChildrenaddChildrenaddErroraddErroraddTypeaddWarningaddWarningbindNamesbindsNameendgetAstRootgetDeepestNodeAtOffsetgetEnclosingNamespacegetFilegetParentgetTablegetTypeisCallisClassDefisFunctionDefisLambdaisModuleisNamelengthresolveExprresolveListresolveListAsUnionsetEndsetParentsetStartsetTypestartvisitNodevisitNodeList

Field Detail

anameback to summary
public NName aname

The alias name, if an "as" clause was specified.

nameback to summary
public String name

The un-parsed qname or simple name corresponding to qname.

qnameback to summary
public NQname qname

Represents one of three possibilities:

  1. import stmt: qname of one of the imported modules
  2. import-from stmt: qname of the referenced module
  3. import-from stmt: simple name imported from referenced module
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides org.python.indexer.ast.NNode.serialVersionUID.

Constructor Detail

NAliasback to summary
public NAlias(String name, NQname qname, NName aname)
NAliasback to summary
public NAlias(String name, NQname qname, NName aname, int start, int end)

Method Detail

getBoundNameback to summary
public String getBoundName()

Returns the alias, if non-null, else the simple name.

resolveback to summary
public NType resolve(Scope s) throws Exception

Overrides org.python.indexer.ast.NNode.resolve.

Resolves and returns the referenced org.python.indexer.types.NModuleType in an import or or import-from statement. NImportFrom statements manually resolve their child NAliases.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
visitback to summary
public void visit(NNodeVisitor v)

Implements abstract org.python.indexer.ast.NNode.visit.

Doc from org.python.indexer.ast.NNode.visit.

Visits this node and optionally its children.

Parameters
v:NNodeVisitor

the object to call with this node. If the visitor returns true, the node also passes its children to the visitor.

Annotations
@Override