Exemplo n.º 1
0
 def set(self, element):
     """
     Replaces the last element returned by next or previous
     with the specified element.
     """
     if self._lastIndex < 0:
         raise JavaError, IllegalStateException("set")
     self._lst[self._lastIndex] = element
Exemplo n.º 2
0
 def remove(self):
     """
     Removes from the list the last element that
     was returned by next or previous.
     """
     if self._lastIndex < 0:
         raise JavaError, IllegalStateException("remove")
     del self._lst[self._lastIndex]
     self._lastIndex = -1  # invalidate state
Exemplo n.º 3
0
 def add(self, element):
     """
     Inserts the specified element into the list.
     The element is inserted immediately before the next element
     that would be returned by next, if any, and after the next
     element that would be returned by previous, if any.
     """
     if self._lastIndex < 0:
         raise JavaError, IllegalStateException("add")
     self._lst.insert(self.index, element)
     self.index += 1
     self._lastIndex = -1  # invalidate state
Exemplo n.º 4
0
 def create(self):
     pushd("/")
     try:
         if self.pbEntity.targetType == None:
             raise IllegalStateException(
                 "pbEntity '" + self.pbEntity.path +
                 "' does not have a target type. (see classifiers.properties and types.properties)"
             )
         create(self.name, self.pbEntity.targetType)
         popd()
     except Exception, e:
         LOGGER.warning("Unable to create entity: " + self.name +
                        ", type='" + self.pbEntity.targetType + "'")
         popd()
         raise e
Exemplo n.º 5
0
def getEntityFactory():
    if len(ENTITY_FACTORIES) > 0:
        return ENTITY_FACTORIES.items()[len(ENTITY_FACTORIES) - 1][1]
    raise IllegalStateException("No entity factory has been created!")