|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.hk2.component.InhabitantsParser
public class InhabitantsParser
Parses /META-INF/inhabitants and populate Habitat.
This class can be subclasses to customize the parsing behavior, which is useful for ignoring some components.
| Field Summary | |
|---|---|
Habitat |
habitat
|
| Constructor Summary | |
|---|---|
InhabitantsParser(Habitat habitat)
|
|
| Method Summary | |
|---|---|
protected void |
add(Inhabitant<?> i)
Adds the given inhabitant to the habitat |
protected void |
add(Inhabitant<?> i,
InhabitantParser parser)
Adds the given inhabitant to the habitat, with all its indices. |
protected void |
addIndex(Inhabitant<?> i,
java.lang.String typeName,
java.lang.String name)
Adds the given inhabitant index to the habitat |
void |
drop(java.lang.Class<?> component)
Tells InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
simply drop it and pretend that such an inhabitant had never existed. |
void |
drop(java.lang.String fullyQualifiedClassName)
|
protected boolean |
isFilteredInhabitant(InhabitantParser inhabitantParser)
Returns true if this inhabitant should be ignored. |
protected boolean |
isFilteredInhabitant(java.lang.String typeName)
Returns true if this inhabitant should be ignored. |
void |
parse(java.lang.Iterable<InhabitantParser> scanner,
Holder<java.lang.ClassLoader> classLoader)
Parses the inhabitants file (which is represented by InhabitantsScanner. |
void |
replace(java.lang.Class<?> oldComponent,
java.lang.Class<?> newComponent)
Tells InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
ignore the one in the inhabitants file and instead insert the specified 'new' component. |
void |
replace(java.lang.String oldComponentFullyQualifiedClassName,
java.lang.Class<?> newComponent)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Habitat habitat
| Constructor Detail |
|---|
public InhabitantsParser(Habitat habitat)
| Method Detail |
|---|
public void drop(java.lang.Class<?> component)
InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
simply drop it and pretend that such an inhabitant had never existed.
This is useful when the application that's hosting an HK2 environment wants to tweak the inhabitant population at sub-module level.
public void drop(java.lang.String fullyQualifiedClassName)
public void replace(java.lang.Class<?> oldComponent,
java.lang.Class<?> newComponent)
InhabitantsParser that if it encounters the specified component
while parsing inhabitants file,
ignore the one in the inhabitants file and instead insert the specified 'new' component.
This is useful when the application that's hosting an HK2 environment wants to tweak the inhabitant population at sub-module level.
public void replace(java.lang.String oldComponentFullyQualifiedClassName,
java.lang.Class<?> newComponent)
public void parse(java.lang.Iterable<InhabitantParser> scanner,
Holder<java.lang.ClassLoader> classLoader)
throws java.io.IOException
InhabitantsScanner.
All the earlier drop/replace commands will be honored during this process.
java.io.IOExceptionprotected boolean isFilteredInhabitant(InhabitantParser inhabitantParser)
inhabitantParser -
protected boolean isFilteredInhabitant(java.lang.String typeName)
typeName -
protected void add(Inhabitant<?> i,
InhabitantParser parser)
protected void add(Inhabitant<?> i)
i -
protected void addIndex(Inhabitant<?> i,
java.lang.String typeName,
java.lang.String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||