Package org.openxava.component
Class MetaComponent
- java.lang.Object
-
- org.openxava.component.MetaComponent
-
- All Implemented Interfaces:
java.io.Serializable
public class MetaComponent extends java.lang.Object implements java.io.Serializable
All meta info about business concept.A business component is all software artifacts that have relation with a business concept. For example, all view, tables, classes, models, etc. about concept of Seller is the Seller business component.
- Author:
- Javier Paniza
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MetaComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAggregateMapping(AggregateMapping aggregateMapping)
void
addMetaAggregate(MetaAggregate metaAggregate)
void
addMetaTab(MetaTab metaTab)
void
addMetaView(MetaView metaView)
static boolean
exists(java.lang.String name)
static MetaComponent
get(java.lang.String name)
AggregateMapping
getAggregateMapping(java.lang.String name)
java.util.Collection
getAggregateMappings()
static java.util.Collection<MetaComponent>
getAll()
static java.util.Collection<MetaComponent>
getAllLoaded()
static java.util.Set
getAllPackageNames()
The names of all the root Java packages used by the components of all OpenXava application in the classpath.EntityMapping
getEntityMapping()
MetaAggregate
getMetaAggregate(java.lang.String name)
java.util.Collection
getMetaAggregates()
java.util.Collection
getMetaAggregatesBeanGenerated()
java.util.Collection
getMetaAggregatesForCollectionPojoGenerated()
MetaEntity
getMetaEntity()
MetaTab
getMetaTab()
MetaTab by default.MetaTab
getMetaTab(java.lang.String name)
MetaTab from name.java.util.Collection
getMetaTabs()
java.lang.String
getName()
java.lang.String
getPackageName()
Java package where the model classes resides.java.lang.String
getPackageNameWithSlashWithoutModel()
Package using / instead of . and it does not includes the model package.IPersistenceProvider
getPersistenceProvider()
static java.lang.String
getQualifiedPackageForUnqualifiedPackage(java.lang.String unqualifiedPackage)
boolean
hasMetaAggregate(java.lang.String name)
boolean
isLabelForModule()
boolean
isMetaDataCached()
boolean
isTransient()
void
setEntityMapping(EntityMapping mapping)
void
setLabelForModule(boolean labelForModule)
void
setMetaDataCached(boolean metaDataCached)
void
setMetaEntity(MetaEntity metaEntity)
void
setName(java.lang.String name)
void
setPackageName(java.lang.String packageName)
void
setPersistenceProvider(IPersistenceProvider persistenceProvider)
void
setTransient(boolean _transient)
-
-
-
Method Detail
-
get
public static MetaComponent get(java.lang.String name) throws ElementNotFoundException, XavaException
- Throws:
ElementNotFoundException
- If component does not exist.XavaException
- Any other problem.
-
exists
public static boolean exists(java.lang.String name) throws XavaException
- Throws:
XavaException
-
getAllLoaded
public static java.util.Collection<MetaComponent> getAllLoaded()
-
getName
public java.lang.String getName()
- Returns:
- Not null and not empty string
-
setName
public void setName(java.lang.String name)
-
getMetaEntity
public MetaEntity getMetaEntity()
- Returns:
- Not null.
-
setMetaEntity
public void setMetaEntity(MetaEntity metaEntity) throws XavaException
- Parameters:
metaEntity
- Not null- Throws:
XavaException
-
addMetaView
public void addMetaView(MetaView metaView) throws XavaException
- Parameters:
metaView
- Not null.- Throws:
XavaException
-
getMetaAggregate
public MetaAggregate getMetaAggregate(java.lang.String name) throws XavaException
- Returns:
- Not null.
- Throws:
ElementNotFoundException
- If the MetaAggregate does not exist in this component.XavaException
- Any other problem.
-
hasMetaAggregate
public boolean hasMetaAggregate(java.lang.String name)
-
getAggregateMapping
public AggregateMapping getAggregateMapping(java.lang.String name) throws XavaException
- Returns:
- Not null
- Throws:
ElementNotFoundException
- If does not exist the aggregate mapping in this component.XavaException
- Any other problem.
-
getAggregateMappings
public java.util.Collection getAggregateMappings() throws XavaException
- Throws:
XavaException
-
getMetaAggregates
public java.util.Collection getMetaAggregates() throws XavaException
- Returns:
- Elementss instanceof MetaAggregate. Not null.
- Throws:
XavaException
- Any other problem.
-
getMetaAggregatesBeanGenerated
public java.util.Collection getMetaAggregatesBeanGenerated() throws XavaException
- Returns:
- Elements instanceof MetaAggregateBean and generate == true. Not null.
- Throws:
XavaException
- Any other problem.
-
getMetaAggregatesForCollectionPojoGenerated
public java.util.Collection getMetaAggregatesForCollectionPojoGenerated() throws XavaException
- Returns:
- Elements instanceof MetaAggregateForCollection and pojoGenerated == true. Not null.
- Throws:
XavaException
- Any problem.
-
addMetaAggregate
public void addMetaAggregate(MetaAggregate metaAggregate)
- Parameters:
metaAggregate
- Not null.
-
addAggregateMapping
public void addAggregateMapping(AggregateMapping aggregateMapping) throws XavaException
- Throws:
XavaException
-
getMetaTab
public MetaTab getMetaTab() throws XavaException
MetaTab by default.- Returns:
- Not null.
- Throws:
XavaException
-
getMetaTabs
public java.util.Collection getMetaTabs()
-
getMetaTab
public MetaTab getMetaTab(java.lang.String name) throws XavaException, ElementNotFoundException
MetaTab from name.- Parameters:
name
- If null or empty string return default tab.- Returns:
- Not null
- Throws:
XavaException
ElementNotFoundException
-
addMetaTab
public void addMetaTab(MetaTab metaTab) throws XavaException
- Throws:
XavaException
-
getEntityMapping
public EntityMapping getEntityMapping() throws XavaException
- Returns:
- Not null.
- Throws:
XavaException
- Any problem, including that mapping for this component does not exist.
-
setEntityMapping
public void setEntityMapping(EntityMapping mapping) throws XavaException
- Throws:
XavaException
-
getPackageName
public java.lang.String getPackageName() throws XavaException
Java package where the model classes resides.- Throws:
XavaException
-
setPackageName
public void setPackageName(java.lang.String packageName)
-
getAllPackageNames
public static java.util.Set getAllPackageNames() throws XavaException
The names of all the root Java packages used by the components of all OpenXava application in the classpath.It's the root package for each application, that it returns
com.gestion400.invoicing
and notcom.gestion400.invoicing.model
.- Returns:
- Of
String
- Throws:
XavaException
-
getQualifiedPackageForUnqualifiedPackage
public static java.lang.String getQualifiedPackageForUnqualifiedPackage(java.lang.String unqualifiedPackage) throws XavaException
- Parameters:
unqualifiedPackage
- For example, of org.openxava.test is test, that is to say, without domain (org.openxava).- Throws:
XavaException
-
getPackageNameWithSlashWithoutModel
public java.lang.String getPackageNameWithSlashWithoutModel() throws XavaException
Package using / instead of . and it does not includes the model package.- Throws:
XavaException
-
getAll
public static java.util.Collection<MetaComponent> getAll() throws XavaException
- Throws:
XavaException
-
isTransient
public boolean isTransient()
-
setTransient
public void setTransient(boolean _transient)
-
getPersistenceProvider
public IPersistenceProvider getPersistenceProvider()
-
setPersistenceProvider
public void setPersistenceProvider(IPersistenceProvider persistenceProvider)
-
isMetaDataCached
public boolean isMetaDataCached()
-
setMetaDataCached
public void setMetaDataCached(boolean metaDataCached)
-
isLabelForModule
public boolean isLabelForModule()
-
setLabelForModule
public void setLabelForModule(boolean labelForModule)
-
-